wanmeiyizhan/main.js
2025-04-17 19:53:09 +08:00

51 lines
995 B
JavaScript

import App from './App'
import store from './store/index'
import api from './utils/api'
import testApi from './utils/testApi'
import utils from './utils/index'
import MyMoment from './utils/moment'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import customLoading from './components/customLoading.vue'
const loading = new Vue({
render: h => h(customLoading)
}).$mount();
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
store,
api,
utils,
...App
})
Vue.prototype.$showLoading = (text) => {
uni.$emit('showLoading', {
text
});
};
Vue.prototype.$hideLoading = () => {
uni.$emit('hideLoading');
};
Vue.prototype.$api = api;
Vue.prototype.$testApi = testApi;
Vue.prototype.$utils = utils;
Vue.prototype.$store = store;
Vue.prototype.$moment = MyMoment;
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif