detail.page.js
673 Bytes
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
const Vue = require('yoho-vue');
const app = require('product/detail/index.vue');
const loading = require('common/loading');
const lazyload = require('yoho-vue-lazyload');
require('../common/overlay');
Vue.use(lazyload);
(() => {
let stop = 0;
$(document).ajaxStart(()=> {
// start = new Date().getTime();
// setTimeout(()=> {
if (stop === 0) { // 超过100ms请求仍未结束则显示
loading.show();
}
// }, 100);
});
$(document).ajaxStop(()=> {
stop = new Date().getTime();
loading.hide();
});
})();
new Vue({
el: '#app',
components: {
app: app
}
});