初始化

This commit is contained in:
wwz
2025-02-07 13:56:35 +08:00
parent f1025605d7
commit 20b5539a82
513 changed files with 56948 additions and 1 deletions

48
main.js Normal file
View File

@@ -0,0 +1,48 @@
import App from './App'
import uviewPlus from '@/uni_modules/uview-plus'
//写个方法,配置一下持久化插件
const createPersistUni = () => {
return createPersistedState({
storage: {
getItem: uni.getStorageSync,
setItem: uni.setStorageSync
}
})
}
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from "vue";
import * as Pinia from "pinia";
import { createUnistorage } from "pinia-plugin-unistorage";
// 写个方法,配置一下持久化插件
const createPersistUni = () => {
return createPersistedState({
storage: {
getItem: uni.getStorageSync,
setItem: uni.setStorageSync
}
})
}
export function createApp() {
const store = Pinia.createPinia()
// 使用持久化插件
store.use(createPersistUni());
const app = createSSRApp(App)
app.use(uviewPlus)
return {
app,
Pinia
}
}
// #endif