MrShi
7 天以前 9c57e2598f463cb6529dd3730ad7a40d178429e1
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
import App from './App'
import Vue from 'vue'
import uView from "uview-ui";
import './uni.promisify.adaptor'
Vue.use(uni)
Vue.config.productionTip = false
App.mpType = 'app'
Vue.use(uView);
 
//禁止滑动
Vue.prototype.stopScroll = function () {
    var box = function(e) { passive: false };
    document.body.style.overflow = 'hidden';
    document.addEventListener("touchmove", box, false);
}
//可以滑动
Vue.prototype.canScroll = function () {
    var box = function(e) { passive: false };
    document.body.style.overflow= '';
    document.removeEventListener("touchmove", box, false);
}
 
 
const app = new Vue({
    ...App
})
 
// http接口API抽离
import httpApi from '@/utils/http.api.js'
Vue.use(httpApi, app)
 
// 请求拦截器
import interceptor from '@/utils/http.interceptor.js'
Vue.use(interceptor, app)
 
app.$mount()