29 lines
606 B
TypeScript
29 lines
606 B
TypeScript
import { createPinia } from 'pinia'
|
|
import { createPersistedState } from 'pinia-plugin-persistedstate'
|
|
import { createSSRApp } from 'vue'
|
|
import App from './App.vue'
|
|
import './styles/tailwind.css'
|
|
|
|
export function createApp() {
|
|
const app = createSSRApp(App)
|
|
const pinia = createPinia()
|
|
pinia.use(customStorage())
|
|
app.use(pinia)
|
|
return {
|
|
app,
|
|
pinia,
|
|
}
|
|
}
|
|
function customStorage() {
|
|
return createPersistedState({
|
|
storage: {
|
|
getItem(key) {
|
|
return uni.getStorageSync(key)
|
|
},
|
|
setItem(key, value) {
|
|
uni.setStorageSync(key, value)
|
|
},
|
|
},
|
|
})
|
|
}
|