【问题标题】:bootstrap javascript not working angular 14bootstrap javascript不工作角度14
【发布时间】:2022-11-03 18:54:27
【问题描述】:

我将引导程序添加到 angular 14 项目中,如下所示: ` “风格”:[

           "src/styles.css",
          "node_modules/bootstrap/scss/bootstrap.scss",
          "node_modules/bootstrap-icons/font/bootstrap-icons.css"
        ],
        "scripts": [
          "node_modules/jquery/dist/jquery.min.js",
          "node_modules/popper.js/dist/umd/popper.min.js",
          "node_modules/bootstrap/dist/js/bootstrap.min.js"
        ]

`

但是所有手风琴和 dropdows 都不起作用(所有库都由 npm 安装并且存在 - 我检查过)。

问题是什么?

【问题讨论】:

    标签: angular bootstrap-4


    【解决方案1】:

    这对我有用:

    "styles": [
      "src/styles.scss",
      "./node_modules/bootstrap/dist/css/bootstrap.min.css"
    ],
    "scripts": [
      "./node_modules/jquery/dist/jquery.min.js",
      "./node_modules/@popperjs/core/dist/umd/popper.min.js",
      "./node_modules/bootstrap/dist/js/bootstrap.min.js"
    ]
    

    尝试@popperjs/core 而不是popper.js

    【讨论】:

      猜你喜欢
      • 2021-07-27
      • 1970-01-01
      • 2013-09-29
      • 1970-01-01
      • 1970-01-01
      • 2015-01-29
      • 2017-08-28
      • 1970-01-01
      • 2017-10-26
      相关资源
      最近更新 更多