1
저는 Yeoman을 처음 접했고 공식 백본 생성기를 사용하여 새 프로젝트를 준비 중입니다. 나는 명령을 사용하여 jQuery를 모바일을 추가했습니다 : 나는 응용 프로그램을 실행하면Yeoman 백본 프로젝트에 jQuery Mobile 추가
bower install -save jquery-mobile
모든 누락 된 내 JQuery와 모바일 스크립트의 보고서를 require.js. 이 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();
});