12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import App from './App'
-
- //Vue2 内容
- // #ifndef VUE3
- import Vue from 'vue'
- Vue.config.productionTip = false
- App.mpType = 'app'
- const app = new Vue({
- ...App
- })
- app.$mount()
- // #endif
-
- //Vue3 内容
- // #ifdef VUE3
- import {
- createSSRApp
- } from 'vue';
- import * as Pinia from 'pinia';
- // import request from '@/static/js/network/request.js';
- import {
- useCounterStore
- } from '@/stores/counter';
-
- export function createApp() {
- const app = createSSRApp(App);
- app.use(Pinia.createPinia());
- //系统属性全局注册
- const counter = useCounterStore();
- app.config.globalProperties.$systemInfo = counter.systemInfo
- // 关闭默认标题栏
- uni.getSystemInfo({
- success: function(res) {
- uni.setStorageSync('__uniapp__statusbar_height', res.statusBarHeight);
- }
- });
- return {
- app,
- Pinia, // 此处必须将 Pinia 返回
- };
- }
-
- // #endif
|