angular6 中使用bootstrap

angular 安装ngx-bootstrap

npm install bootstrap --save

npm install --save @ng-bootstrap/ng-bootstrap

在style.scss中引入css

@import "~bootstrap/dist/css/bootstrap.css";

 

在app.module注入

import {NgbModule} from '@ng-bootstrap/ng-bootstrap';

imports: [
...
NgbModule,
 ...
],

 

在页面中使用

<button type="button" class="btn btn-primary">
  Single Button
</button>

 

效果:

 

posted @ 2018-09-18 15:41  king_94boy  阅读(1905)  评论(0)    收藏  举报