mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 19:29:04 +08:00
perf: perf loading logic
This commit is contained in:
@@ -4,15 +4,11 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, unref } from 'vue';
|
||||
|
||||
import { appStore } from '/@/store/modules/app';
|
||||
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting';
|
||||
export default defineComponent({
|
||||
name: 'Redirect',
|
||||
setup() {
|
||||
const { currentRoute, replace } = useRouter();
|
||||
const { getOpenPageLoading, getEnableTransition } = useTransitionSetting();
|
||||
|
||||
const { params, query } = unref(currentRoute);
|
||||
const { path } = params;
|
||||
@@ -21,12 +17,7 @@
|
||||
path: '/' + _path,
|
||||
query,
|
||||
});
|
||||
// close loading
|
||||
if (unref(getEnableTransition) && unref(getOpenPageLoading)) {
|
||||
setTimeout(() => {
|
||||
appStore.setPageLoadingAction(false);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
return {};
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user