File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- import useRouteCache from ' @/stores/modules/routeCache '
2+ import { useRouteCacheStore } from ' @/stores'
33
44useHead ({
55 title: ' Vue3 Vant Mobile' ,
@@ -22,8 +22,10 @@ useHead({
2222 ],
2323})
2424
25+ const routeCacheStore = useRouteCacheStore ()
26+
2527const keepAliveRouteNames = computed (() => {
26- return useRouteCache () .routeCaches as string []
28+ return routeCacheStore .routeCaches
2729})
2830
2931const mode = computed (() => {
Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import { storeToRefs } from ' pinia'
3- import useCounterStore from ' @/stores/modules/counter '
3+ import { useCounterStore } from ' @/stores'
44
55const counterStore = useCounterStore ()
66const { counter } = storeToRefs (counterStore )
Original file line number Diff line number Diff line change @@ -5,8 +5,7 @@ import NProgress from 'nprogress'
55import 'nprogress/nprogress.css'
66
77import type { EnhancedRouteLocation } from './types'
8- import useRouteCacheStore from '@/stores/modules/routeCache'
9- import { useUserStore } from '@/stores'
8+ import { useRouteCacheStore , useUserStore } from '@/stores'
109
1110import { isLogin } from '@/utils/auth'
1211import setPageTitle from '@/utils/set-page-title'
Original file line number Diff line number Diff line change @@ -2,9 +2,11 @@ import { createPinia } from 'pinia'
22import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
33
44import useUserStore from './modules/user'
5+ import useCounterStore from './modules/counter'
6+ import useRouteCacheStore from './modules/routeCache'
57
68const pinia = createPinia ( )
79pinia . use ( piniaPluginPersistedstate )
810
9- export { useUserStore }
11+ export { useUserStore , useCounterStore , useRouteCacheStore }
1012export default pinia
You can’t perform that action at this time.
0 commit comments