首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >toubles导入bootstrap4-切换到angular 8

问toubles导入bootstrap4-切换到angular 8
EN

Stack Overflow用户
提问于 2019-11-20 04:20:19
回答 1查看 1.1K关注 0票数 0

我是Angular的新手,我正在尝试从这个源码导入bootstrap4- https://gitbrent.github.io/bootstrap4-toggle/#api到我的项目中添加一个切换复选框:)我运行npm安装,我在packjage.json中找到了项目中的包,现在我需要将它添加到“样式”中,但我不知道要添加什么,我已经尝试过了

代码语言:javascript
复制
 "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"
            ],

但它并没有起作用。我在导航栏中使用过这个标签

代码语言:javascript
复制
<input type="checkbox" checked data-toggle="toggle">

它应该看起来像一个切换按钮,而不是看起来像一个普通的html复选框。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-11-20 04:43:54

在angular.json中的脚本和样式处添加导入

代码语言:javascript
复制
"styles": [
    "src/styles.css",
    "node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css"
],
"scripts": [
    "node_modules/bootstrap4-toggle/js/bootstrap4-toggle.min.js"
]
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58942209

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档