xnzt/xnzt-h5/main.js

54 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2024-11-11 10:27:27 +08:00
import Vue from 'vue'
import App from './App'
import store from './store' // store
import plugins from './plugins' // plugins
import './permission' // permission
import { getDicts } from "@/api/system/dict/data";
import ImageUpload from "@/components/image-upload"
import listeningOnBack from '@/utils/listeningOnBack'
import http from '@/static/js/http.js'
import config from './config.js'
Vue.use(plugins)
// main.js
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)
Vue.prototype.$http = http;
//页面跳转
let flag = false
const pageTo = (url) => {
if (!flag) {
flag = true
uni.showLoading();
uni.navigateTo({
url,
success: () => {
flag = false;
uni.hideLoading();
},
fail: () => {
flag = false;
uni.hideLoading();
}
})
}
}
// 全局方法挂载
Vue.prototype.$pageTo = pageTo;
Vue.config.productionTip = false
Vue.prototype.$store = store
Vue.prototype.getDicts = getDicts
Vue.prototype.$listenOB = listeningOnBack
Vue.prototype.$listenOB = listeningOnBack
Vue.prototype.$config = config
// 全局组件挂载
Vue.component('ImageUpload', ImageUpload)
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()