更改动态导航栏
This commit is contained in:
40
main.js
40
main.js
@@ -1,15 +1,5 @@
|
||||
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'
|
||||
@@ -22,27 +12,23 @@ 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
|
||||
}
|
||||
})
|
||||
}
|
||||
import {
|
||||
createSSRApp
|
||||
} from "vue";
|
||||
import * as Pinia from 'pinia';
|
||||
import { createUnistorage } from './uni_modules/pinia-plugin-unistorage'
|
||||
export function createApp() {
|
||||
const store = Pinia.createPinia()
|
||||
// 使用持久化插件
|
||||
store.use(createPersistUni());
|
||||
// 状态管理
|
||||
const app = createSSRApp(App)
|
||||
// 状态管理
|
||||
const store = Pinia.createPinia()
|
||||
// 持久化
|
||||
store.use(createUnistorage())
|
||||
app.use(store)
|
||||
app.use(uviewPlus)
|
||||
return {
|
||||
app,
|
||||
Pinia
|
||||
}
|
||||
Pinia,
|
||||
};
|
||||
}
|
||||
// #endif
|
||||
Reference in New Issue
Block a user