且构网

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

如何将Twitter Bootstrap集成到一个ember-cli应用程序中?

更新时间:2023-02-13 07:47:05

自举引导已被弃用,这意味着您不应该使用 ember-cli-bootstrap-sass 用于新项目,因为它利用了自举换余烬。因此,使用 ember-cli v0.1.12,我使用 ember-cli-bootstrap-sassy ,被描述为a href =https:// github .com / unionups / ember-cli-bootstrap-sas-s-rel =nofollow> ember-cli-bootstrap-sass ,但没有任何依赖于现在已经停止的 bootstrap-for-ember



要安装 ember-cli-bootstrap-sassy ,从您的 ember-cli 项目目录:

  $ ember install:addon ember-cli-bootstrap-sassy 


I am using Ember 1.7.0 and trying to integrate the Twitter Bootstrap CSS Framework into an ember-cli app.

I have seen some articles about this online, but most seem to be pretty outdated. As of today, I've managed to put information from articles online together and have come up with this.

bower install --save bootstrap-sass-official

Then check bower.json to see if something along the lines is included:

"bootstrap-sass-official": "~3.3.1"

Include the following lines in your Brocfile.js:

app.import('bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js');
app.import('bower_components/bootstrap-sass-official/assets/stylesheets/_bootstrap.scss');

Restart ember-server. Navigate to http://localhost:4200/assets/vendor.js. See that Twitter Bootstrap source code is in there.

However, at http://localhost:4200/assets/vendor.css, I don't see any indication....

Is this the right way to install? Am I missing something?

bootstrap-for-ember has been deprecated, which means you shouldn't use ember-cli-bootstrap-sass for new projects either since that utilizes bootstrap-for-ember. Therefore, with ember-cli v0.1.12, I'm using ember-cli-bootstrap-sassy, which is described as "a fork of ember-cli-bootstrap-sass but without any dependencies on the now defunct bootstrap-for-ember."

To install ember-cli-bootstrap-sassy, run the following command from the root of your ember-cli project directory:

$ ember install:addon ember-cli-bootstrap-sassy