src/App.vue
@@ -5,7 +5,7 @@ <AppHeader class="flex-0" /> <div id="app-page" class="flex-auto !overflow-y-auto bg-[#ffffff]" ref="containerRef"> <div class="w-[100%] mx-auto"> <router-view></router-view> <router-view :key="routerKey"></router-view> </div> <AppFooter></AppFooter> </div> @@ -30,7 +30,9 @@ const isLoginPage = computed(() => { return route.path === '/login'; }); let routerKey = computed(() => { return `${route.path}?v=${Math.random()}`; }); // 监听路由变化,滚动到顶部 watch( () => route.path,