This commit is contained in:
zhangtao 2022-07-07 09:05:56 +08:00
parent 5686578b75
commit dbb5c5d2bc
4 changed files with 7 additions and 2 deletions

View File

@ -17,6 +17,7 @@
"dayjs": "^1.11.2",
"mockjs": "^1.1.0",
"pinia": "^2.0.13",
"pinia-persistedstate-plugin": "^0.1.0",
"tinymce": "^5.10.2",
"vue": "^3.2.16",
"vue-router": "^4.0.14",

View File

@ -29,7 +29,7 @@
</template>
<script>
import { computed, reactive, ref, unref, toRaw } from 'vue'
import { computed, ref, unref } from 'vue'
import { NForm } from 'naive-ui'
import AreaCascader from '@/components/AreaCascader/index.vue'
export default {

View File

@ -1,5 +1,8 @@
import { createPinia } from 'pinia'
import { createPersistedState } from 'pinia-persistedstate-plugin'
const store = createPinia()
store.use(createPersistedState())
export function setupStore(app) {
app.use(createPinia())
app.use(store)
}

View File

@ -3,6 +3,7 @@ import { getUser } from '@/api/user'
import { removeToken } from '@/utils/token'
export const useUserStore = defineStore('user', {
persist: true,
state() {
return {
userInfo: {}