且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何在ionic 4应用程序中添加和使用引导程序

更新时间:2023-10-31 21:32:46

使用Ionic 4,可以通过使用angular.json文件轻松完成

With Ionic 4, this can be done easily by making use of the angular.json file

打开angular.json 文件,该文件可以位于项目的根目录

open the angular.json file, this can be located at the root of your project

找到样式数组,将路径添加到下载的引导程序文件中

locate the the styles array, add the path to the downloaded bootstrap file

"styles": [
          {
            "input": "src/theme/variables.scss"
          },
          {
            "input": "src/global.scss"
          },
          {
            "input": "node_modules/bootstrap/dist/css/bootstrap.min.css"
          }
        ],

如果您希望使用引导脚本,请将引导脚本也添加到scripts数组中.

if you wish to make use of bootstrap scripts, add the bootstrap script to the scripts array as well.

请注意::要使用引导脚本,还必须将jquery和popper.js添加到您的项目中

Please note: for you to make use of bootstrap scripts, jquery and popper.js are required to be added to your projects as well