我在main.js脚本中有这个代码,但我不能使它适用于jQueryUI,因为不知何故,当尝试加载jQueryMobile时,它总是在jquery.ui.widget之前加载jquery.ui.tabs,后者是前者的依赖
requirejs.config({
baseUrl: './js',
paths: {
'libs' : '../libs',
'jquery' : '../libs/jquery/jquery.min',
'jquery-plugins' : '../libs/jquery-mobile/external/jquery/plugins',
'jquery-ui' : '../libs/jquery-ui/ui',
"jquery.ui.widget" : '../libs/jquery-ui/ui/jquery.ui.widget',
'jquery.ui.tabs' : '../libs/jquery-ui-tabs/ui/jquery.ui.tabs',
'jquery-mobile' : '../libs/jquery-mobile/js/',
'backbone' : '../libs/backbone/backbone',
'underscore' : '../libs/underscore/underscore',
'json' : '../libs/json2/json',
'json2' : '../libs/json2',
'jstorage' : '../libs/jstorage/jstorage.min',
'mustache' : '../libs/mustache'
},
shim: {
'underscore': {
exports: '_'
},
'backbone': {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
'json': {
exports:'JSON'
},
'jstorage': ['jquery', 'json'],
'mustache': {
exports: 'Mustache'
},
'jquery-plugins' : ['jquery'],
'jquery.ui.widget' : ['jquery', 'jquery.ui.core'],
'jquery.ui.tabs' : [ 'jquery' , 'jquery.ui.widget']
}
});
require(['app'], function(App){
$(document).on('mobileinit', function(){
console.log('Evento mobileinit');
App.initialize();
});
})