您可以将Bootstrap添加到Ionic应用程序吗? [英] Can you add Bootstrap to a Ionic App?

查看:55
本文介绍了您可以将Bootstrap添加到Ionic应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发Ionic应用程序,我想知道是否可以添加基于Bootstrap的图片库.我知道Ionic和Bootstrap不能很好地协同工作,但是我想知道是否有可能.

I am currently developing an Ionic app and I was wondering if I could add an image gallery based on Bootstrap. I know Ionic and Bootstrap don't work really well together, but I was wondering if it is possible.

推荐答案

步骤1:
安装引导程序:

Step 1:
Install bootstrap:

npm安装引导程序

npm install bootstrap

获取引导程序

第2步:

编辑package.json:

Edit package.json:

"description": "An Ionic project",
......
"config": {
    "ionic_sass": "./sass.config.js"
}

第3步:

在主文件夹中创建新文件sass.config.js

Create new file sass.config.js in home folder

module.exports = {
includePaths: [
    "node_modules/ionic-angular/themes",
    "node_modules/ionicons/scss",
    "node_modules/ionic-angular/fonts",
    "node_modules/bootstrap/scss"
  ]
};

第4步:

编辑variables.scss

Edit variables.scss

@import "noto-sans";
......
@import "bootstrap";

第5步:

添加您的引导程序代码:

Add your bootstrap code:

<button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-secondary">Secondary</button>
<button type="button" class="btn btn-success">Success</button>

第6步:

运行离子应用程序

离子服务

这篇关于您可以将Bootstrap添加到Ionic应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆