angular6 中使用bootstrap

mac2022-06-30  26

npm install jquery   --save

npm install popper.js   --save

npm install bootstrap   --save

 

 

然后在node_modules文件夹中可以找到你安装的文件

接下来开始修改配置文件

 

在angular.json 文件中添加它们

"styles": [ "src/styles.css", "./node_modules/bootstrap/dist/css/bootstrap.css"],"scripts": [ "./node_modules/jquery/dist/jquery.slim.js", "./node_modules/popper.js/dist/umd/popper.js", "./node_modules/bootstrap/dist/js/bootstrap.js"]

 保存后重启服务

  测试一下:在页面中使用bootstrap测试一下

 

okok 完全没有问题了

(给你一个按钮去试试吧)

<button type="button" class="btn btn-success">hello</button>

转载于:https://www.cnblogs.com/king94Boy/p/9669284.html

最新回复(0)