refactor: refactor setting

This commit is contained in:
vben
2020-11-25 00:43:33 +08:00
parent 0692b4798c
commit 41d79008c5
20 changed files with 248 additions and 183 deletions

View File

@@ -7,10 +7,13 @@
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;
const _path = Array.isArray(path) ? path.join('/') : path;
@@ -18,8 +21,7 @@
path: '/' + _path,
query,
});
const { openRouterTransition, openPageLoading } = appStore.getProjectConfig;
if (openRouterTransition && openPageLoading) {
if (unref(getEnableTransition) && unref(getOpenPageLoading)) {
setTimeout(() => {
appStore.setPageLoadingAction(false);
}, 0);