您的位置:首页 > Web前端 > BootStrap

Angular开发 使用 ngx-bootstrap作为样式库

2018-02-08 11:45 671 查看

ngx-bootstrap里面可以复制你想要的样式组件,官方有介绍怎么使用,不过本人稍微修改了下

使用
ngx-bootstrap
的步骤1、npm install ngx-bootstrap –save
2、npm install bootstarap –save-dev
3、在angular-cli.json文件中添加bootstrap为全局样式
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.css"
],
1
2
3
4
4、根据官方文档中你需要使用什么样式就要在
app.module.ts
注入
import { AccordionModule,AlertModule,ButtonsModule } from 'ngx-bootstrap';

@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
AccordionModule.forRoot(),
AlertModule.forRoot(),
ButtonsModule.forRoot()
],
1
2
3
4
5
6
7
8
9
10
11
12
13
14
5、直接官网复制代码
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐