qwe*_*123 2 twitter-bootstrap sails.js
我是帆船和自举船的新手.我需要在现有的sails v0.10项目中集成bootstrap.请告诉我我应该采取的步骤.提前致谢.
小智 8
您可以添加以下步骤:
在task/pipeline.js中添加jquery dependecies,因为bootstrap需要jquery.js,如下面的代码:
// Client-side javascript files to inject in order
// (uses Grunt-style wildcard/glob/splat expressions)
var jsFilesToInject = [
// Load sails.io before everything else
'js/dependencies/sails.io.js',
// load jquery before bootstrap
'js/dependencies/jquery-1.10.2.min.js',
// Dependencies like jQuery, or Angular are brought in here
'js/dependencies/**/*.js',
// All of the rest of your client-side js files
// will be injected here in no particular order.
'js/**/*.js'
];
Run Code Online (Sandbox Code Playgroud)
然后当你使用命令sails升级运行sails时,自动grunt任务运行并在你的布局中使你的依赖项配置工具像这样
<script src="/js/dependencies/sails.io.js"></script>
<script src="/js/dependencies/jquery-1.10.2.min.js"></script>
<script src="/js/bootstrap/bootstrap.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
Jquery将在bootstrap之前加载.
希望可以帮到你
| 归档时间: |
|
| 查看次数: |
2998 次 |
| 最近记录: |