]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor: move computed above
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 9 Sep 2020 12:06:49 +0000 (14:06 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 9 Sep 2020 12:06:49 +0000 (14:06 +0200)
e2e/modal/index.ts

index f5c8a2ce6cfec11480c5bf869334c05edf026bc8..d230a41f00f081e07a796885ed6c493807dc9e11 100644 (file)
@@ -141,6 +141,7 @@ router.beforeEach((to, from, next) => {
 const app = createApp({
   setup() {
     const route = useRoute()
+    const historyState = computed(() => route.fullPath && window.history.state)
     const routeWithModal = computed(() => {
       if (historyState.value.backgroundView) {
         return router.resolve(
@@ -150,7 +151,6 @@ const app = createApp({
         return route
       }
     })
-    const historyState = computed(() => route.fullPath && window.history.state)
 
     return { route, routeWithModal, historyState, ...toRefs(route) }
   },