Explorar o código

main组件的key改为hash,而不是fullpath

louhangfei %!s(int64=2) %!d(string=hai) anos
pai
achega
02d263eb0f
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/layout/components/Main/index.vue

+ 2 - 2
src/layout/components/Main/index.vue

@@ -3,9 +3,9 @@
     <template #default="{ Component, route }">
       <transition :name="getTransitionName" appear mode="out-in">
         <keep-alive v-if="keepAliveComponents" :include="keepAliveComponents">
-          <component :is="Component" :key="route.fullPath" />
+          <component :is="Component" :key="route.hash" />
         </keep-alive>
-        <component :is="Component" v-else :key="route.fullPath" />
+        <component :is="Component" v-else :key="route.hash" />
       </transition>
     </template>
   </RouterView>