File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -59,13 +59,12 @@ export const setupGlobalComputed = (
59
59
router : Router ,
60
60
clientConfigs : ClientConfig [ ]
61
61
) : GlobalComputed => {
62
- // create global computed
63
62
const layouts = computed ( ( ) => resolvers . resolveLayouts ( clientConfigs ) )
63
+ // create eager computed for route path and locale, so that route changes
64
+ // won't make all downstream computed re-evaluate
65
+ const routePath = computedEager ( ( ) => router . currentRoute . value . path )
64
66
const routeLocale = computedEager ( ( ) =>
65
- resolvers . resolveRouteLocale (
66
- siteData . value . locales ,
67
- router . currentRoute . value . path
68
- )
67
+ resolvers . resolveRouteLocale ( siteData . value . locales , routePath . value )
69
68
)
70
69
const siteLocaleData = computed ( ( ) =>
71
70
resolvers . resolveSiteLocaleData ( siteData . value , routeLocale . value )
You can’t perform that action at this time.
0 commit comments