-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
59 lines (53 loc) · 1.71 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
'use strict';
(function (win) {
requirejs.onError = function (err) {
if (err.requireType === 'timeout') {
location.reload();
}
else {
throw err;
}
};
requirejs.config({
baseUrl: "/assets/js",
waitSeconds: 8,//超时时间设为6秒
onNodeCreated: function (node, config, moduleName, url) {
//console.log('module ' + moduleName + ' is about to be loaded');
NProgress.start();
node.addEventListener('load', function () {
//console.log('module ' + moduleName + ' has been loaded');
NProgress.done();
});
////加载模块出错自动刷新页面
//node.addEventListener('error', function () {
// debugger;
// location.reload();
//});
},
paths: {
"jquery": "jquery-1.11.3",
"jqueryui": "jquery-ui",
"juiall": "jui/jui",
"jquerydatepicker": "i18n/datepicker-zh-CN",
"slimscroll": "jquery.slimscroll.min",
"mock": "mock",
//"vue": '/assets/lib/vue/vue2.min',
//"element":'/assets/lib/element-ui-2.4.1/index'
},
"shim": {
"slimscroll": ["jquery"],
//"element":['vue'],
// 'vue': {
// exports: 'vue'
// }
},
urlArgs: "v=2.1.2"// + (new Date()).getTime()
});
require(['jquery', 'mock', 'jqueryui', 'juiall', 'jquerydatepicker', 'slimscroll'], function ($, Mock) {
win.Mock = Mock;
var config = {
viewsDir: 'views'
};
$.router.start(config);
});
})(window);