angular - 为什么我的导航选项卡不适用于 Angular 为 4 的 bootstrap 4

标签 angular bootstrap-4

我正在尝试将 bootstrap 4 的选项卡与 angular 4 一起使用 我希望它看起来像这样 enter link description here

但是我的页面是这样的。 enter image description here

下面是我的代码:

Angular -cli.json:

"prefix": "app",
  "styles": [
    "styles.css",
    "../node_modules/bootstrap/dist/css/bootstrap.min.css",
    "../node_modules/bootswatch/dist/cosmo/bootstrap.css",
    "../node_modules/font-awesome/css/font-awesome.css"
  ],
  "addons":[
    "../node_modules/font-awesome/font/*.+(otf|eot|svg|ttf|woff|woff2)"
  ],
  "scripts": [
   "../node_modules/jquery/dist/jquery.min.js",
    "../node_modules/tether/dist/js/tether.min.js",
   "../node_modules/bootstrap/dist/js/bootstrap.min.js"
  ],

main.componenet.html

<ul class="nav nav-tab">
    <li class="nav-item">  home <i class="fa fa-home"></i></li>
    <li class="nav-item">product</li>
</ul>

没有错误,但仍然看不到标签。我不确定为什么?

最佳答案

你可以使用这个模板

<ul class="nav nav-tabs">
    <li class="nav-item">
        <a class="nav-link active" href="#">home
            <i class="fa fa-home"></i>
        </a>
    </li>
    <li class="nav-item">
        <a class="nav-link" href="#">Product</a>
    </li>
</ul>

关于angular - 为什么我的导航选项卡不适用于 Angular 为 4 的 bootstrap 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51760730/

相关文章:

jquery - 如何在 HTML 页面中对特定的 div 实现滚动功能

angular - 如何使用引导导航栏和下拉菜单(使用 Angular 7)?

javascript - 如何设置Angular 2.0的环境?

node.js - 带有 primeng 404 问题的 angular-cli@webpack

node.js - Angular 2 实时站点与 npm 启动站点不同

angular - 是否可以使用 ng-mocks 从模拟服务中保留一些方法?

javascript - 使用 Bootstrap 4 Modal 进行 react

css - Accordion 内的 Bootstrap 下拉菜单

twitter-bootstrap - 使用 Bootstrap 的 Angular 4 下拉菜单

css - Bootstrap 4 卡/面板,带有标题和标题左侧的图像