我是Angular的新手,我正在尝试从这个源码导入bootstrap4- https://gitbrent.github.io/bootstrap4-toggle/#api到我的项目中添加一个切换复选框:)我运行npm安装,我在packjage.json中找到了项目中的包,现在我需要将它添加到“样式”中,但我不知道要添加什么,我已经尝试过了
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css",
"src/styles.css",
"node_modules/font-awesome/css/font-awesome.css"
],但它并没有起作用。我在导航栏中使用过这个标签
<input type="checkbox" checked data-toggle="toggle">它应该看起来像一个切换按钮,而不是看起来像一个普通的html复选框。
发布于 2019-11-20 04:43:54
在angular.json中的脚本和样式处添加导入
"styles": [
"src/styles.css",
"node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css"
],
"scripts": [
"node_modules/bootstrap4-toggle/js/bootstrap4-toggle.min.js"
]https://stackoverflow.com/questions/58942209
复制相似问题