import Vue from 'vue' import App from './App' import store from './store' Vue.config.productionTip = false // 注册全局方法 Vue.prototype.getSystemInfo = function() { return new Promise((resolve, reject) => { uni.getSystemInfo({ success: resolve, fail: reject }) }) } Vue.prototype.navigateTo = function(url) { uni.navigateTo({ url }) } Vue.prototype.switchTab = function(url) { uni.switchTab({ url }) } Vue.prototype.reLaunch = function(url) { uni.reLaunch({ url }) } Vue.prototype.redirectTo = function(url) { uni.redirectTo({ url }) } Vue.prototype.goBack = function(delta = 1) { uni.navigateBack({ delta }) } Vue.prototype.$showLoading = function(text = '加载中') { uni.showLoading({ title: text, mask: false }) } Vue.prototype.$hideLoading = function() { uni.hideLoading() } App.mpType = 'app' const app = new Vue({ store, ...App }) app.$mount()