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 1
1
<script setup lang="ts">
2
- import useRouteCache from ' @/stores/modules/routeCache '
2
+ import { useRouteCacheStore } from ' @/stores'
3
3
4
4
useHead ({
5
5
title: ' Vue3 Vant Mobile' ,
@@ -22,8 +22,10 @@ useHead({
22
22
],
23
23
})
24
24
25
+ const routeCacheStore = useRouteCacheStore ()
26
+
25
27
const keepAliveRouteNames = computed (() => {
26
- return useRouteCache () .routeCaches as string []
28
+ return routeCacheStore .routeCaches
27
29
})
28
30
29
31
const mode = computed (() => {
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
import { storeToRefs } from ' pinia'
3
- import useCounterStore from ' @/stores/modules/counter '
3
+ import { useCounterStore } from ' @/stores'
4
4
5
5
const counterStore = useCounterStore ()
6
6
const { counter } = storeToRefs (counterStore )
Original file line number Diff line number Diff line change @@ -5,8 +5,7 @@ import NProgress from 'nprogress'
5
5
import 'nprogress/nprogress.css'
6
6
7
7
import type { EnhancedRouteLocation } from './types'
8
- import useRouteCacheStore from '@/stores/modules/routeCache'
9
- import { useUserStore } from '@/stores'
8
+ import { useRouteCacheStore , useUserStore } from '@/stores'
10
9
11
10
import { isLogin } from '@/utils/auth'
12
11
import setPageTitle from '@/utils/set-page-title'
Original file line number Diff line number Diff line change @@ -2,9 +2,11 @@ import { createPinia } from 'pinia'
2
2
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
3
3
4
4
import useUserStore from './modules/user'
5
+ import useCounterStore from './modules/counter'
6
+ import useRouteCacheStore from './modules/routeCache'
5
7
6
8
const pinia = createPinia ( )
7
9
pinia . use ( piniaPluginPersistedstate )
8
10
9
- export { useUserStore }
11
+ export { useUserStore , useCounterStore , useRouteCacheStore }
10
12
export default pinia
You can’t perform that action at this time.
0 commit comments