Files
dvcp_v2_wxcp_app/src/main.js
yanran200730 47d9213b70 工作汇报
2022-03-29 16:30:39 +08:00

52 lines
1.2 KiB
JavaScript

import Vue from 'vue';
import App from './App';
import store from './store';
import axios from './common/axios';
import utils from './common/util';
import ui from 'uview-ui'
import VConsole from 'vconsole'
const loading = title => {
uni.showLoading({
title: title ? title : '加载中',
mask: true
})
}
const hideLoading = () => {
uni.hideLoading()
}
Vue.prototype.$loading = loading
Vue.prototype.$hideLoading = hideLoading
Vue.use(ui)
Vue.config.productionTip = false;
//初始化接口工具类
Vue.prototype.$http = axios;
Vue.prototype.$cdn = 'https://cdn.cunwuyun.cn/dvcp/h5/';
Object.keys(utils).map((e) => (Vue.prototype['$' + e] = utils[e]));
utils.dict.init({instance: axios})
App.mpType = 'app';
process.env.NODE_ENV == 'development' && new VConsole();
const app = new Vue({
store,
...App
});
app.$mount();
// store.dispatch("agentSign").then(config => {
// const init = (c = 0) => {
// if (config) {
// store.commit("getConfig", {...config, latlng: [config.lat, config.lng]})
// app.$mount();
// } else {
// if (c < 5) {
// setTimeout(() => {
// init(++c)
// }, 300)
// }
// }
// }
// init()
// })