1
我是Yeoman的新手,我正在使用官方Backbone生成器創建一個新項目。我已經使用命令加入jQuery Mobile的:將jQuery Mobile添加到Yeoman Backbone項目
bower install -save jquery-mobile
當我運行應用程序,require.js我所有的jQuery的移動腳本失蹤報告。我已閱讀這篇文章here和here。我必須錯過一步,或讓我的main.js設置錯誤。
這裏是我main.js的相關部分:
require.config({
shim: {
<...>
jquerymobileconfig: {
deps: [
'jquery'
]
},
jquerymobile: {
deps: [
'jquery',
'jquerymobileconfig'
]
}
},
paths: {
jquery: '../bower_components/jquery/jquery',
jquerymobileconfig: 'jqmconfig',
jquerymobile: '../bower_components/jquery-mobile/js/jquery.mobile',
backbone: '../bower_components/backbone/backbone',
underscore: '../bower_components/underscore/underscore'
}
});
require([
'jquery', 'backbone', 'jquerymobile'
], function ($, Backbone) {
Backbone.history.start();
});