Skip to content

Commit

Permalink
修复:修复浏览器刷新时,页面加载动画不结束问题;
Browse files Browse the repository at this point in the history
  • Loading branch information
iczer committed May 7, 2023
1 parent dc43225 commit 9185c89
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/pages/Exp404.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@
<script lang="ts" setup>
import ReadingLoader from '@/components/loaders/ReadingLoader.vue';
import { configPage } from 'stepin/es/tabs-view';
import { useRoute } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import { useMenuStore, storeToRefs } from '@/store';
import { watch } from 'vue';
const props = defineProps({
loading: Boolean,
});
const route = useRoute();
const { loading: _loading } = storeToRefs(useMenuStore());
const router = useRouter();
// fix: 修复浏览器刷新时,页面加载动画不结束问题;(暂不知道为啥这段代码能起作用)
watch(_loading, () => {
router.push('');
});
if (props.loading) {
configPage(route, { title: 'loading' });
configPage(route, { title: undefined });
Expand Down

0 comments on commit 9185c89

Please sign in to comment.