Bootstrap在Angular 6应用中不起作用 [英] Bootstrap not working in Angular 6 app
本文介绍了Bootstrap在Angular 6应用中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Angular 6应用中使用Bootstrap,这是我到目前为止所做的,但似乎没有任何效果:
I want to make use of Bootstrap in an Angular 6 app and here is what I have done so far but nothing seems to be working out:
1)使用npm安装了bootstrap,jquery和popper.js. 2)在Angular.json文件中输入以下内容
1) Installed bootstrap, jquery and popper.js using npm. 2) Entered the following in the Angular.json file
"styles": [
"src/styles.scss",
"node_modules/bootstrap/scss/bootstrap.scss"
],
"scripts": [
"node_modules/jquery/dist/jquery.slim.min.js",
"node_modules/popper.js/dist/umd/popper.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
...
]
我错过了什么吗?这似乎没有解决.
Am I missing something. This doesn't seems to work out.
推荐答案
使用import
@import "node_modules/bootstrap/scss/bootstrap.scss"
并从angular.json
文件中删除"node_modules/bootstrap/scss/bootstrap.scss"
这篇关于Bootstrap在Angular 6应用中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文