mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-09 05:29:32 +00:00
fix: fix the problem of page blank caused by page refresh
This commit is contained in:
@@ -6,23 +6,17 @@ import { ContentEnum } from '/@/enums/appEnum';
|
||||
import { appStore } from '/@/store/modules/app';
|
||||
// import { RouterView } from 'vue-router';
|
||||
import PageLayout from '/@/layouts/page/index';
|
||||
import FrameLayout from '/@/layouts/iframe/index.vue';
|
||||
|
||||
import { useSetting } from '/@/hooks/core/useSetting';
|
||||
export default defineComponent({
|
||||
name: 'DefaultLayoutContent',
|
||||
setup() {
|
||||
const { projectSetting } = useSetting();
|
||||
|
||||
return () => {
|
||||
const { getProjectConfig } = appStore;
|
||||
const { contentMode } = getProjectConfig;
|
||||
|
||||
const wrapClass = contentMode === ContentEnum.FULL ? 'full' : 'fixed';
|
||||
return (
|
||||
<Layout.Content class={`layout-content ${wrapClass} `}>
|
||||
{{
|
||||
default: () => [<PageLayout />, projectSetting.canEmbedIFramePage && <FrameLayout />],
|
||||
default: () => <PageLayout />,
|
||||
}}
|
||||
</Layout.Content>
|
||||
);
|
||||
|
@@ -6,7 +6,9 @@ import { useTransition } from './useTransition';
|
||||
|
||||
import { RouterView, RouteLocation } from 'vue-router';
|
||||
import { tabStore } from '/@/store/modules/tab';
|
||||
import FrameLayout from '/@/layouts/iframe/index.vue';
|
||||
|
||||
import { useSetting } from '/@/hooks/core/useSetting';
|
||||
// import { useRouter } from 'vue-router';
|
||||
export default defineComponent({
|
||||
name: 'PageLayout',
|
||||
@@ -22,6 +24,7 @@ export default defineComponent({
|
||||
const { on: transitionOn } = useTransition();
|
||||
on = transitionOn;
|
||||
}
|
||||
const { projectSetting } = useSetting();
|
||||
return () => {
|
||||
const {
|
||||
routerTransition,
|
||||
@@ -32,32 +35,35 @@ export default defineComponent({
|
||||
|
||||
const openCache = openKeepAlive && show;
|
||||
const cacheTabs = toRaw(tabStore.getKeepAliveTabsState) as string[];
|
||||
return [
|
||||
<RouterView>
|
||||
{{
|
||||
default: ({ Component, route }: { Component: any; route: RouteLocation }) => {
|
||||
const Content = openCache ? (
|
||||
<KeepAlive max={max} include={cacheTabs}>
|
||||
return (
|
||||
<div>
|
||||
<RouterView>
|
||||
{{
|
||||
default: ({ Component, route }: { Component: any; route: RouteLocation }) => {
|
||||
const Content = openCache ? (
|
||||
<KeepAlive max={max} include={cacheTabs}>
|
||||
<Component {...route.params} />
|
||||
</KeepAlive>
|
||||
) : (
|
||||
<Component {...route.params} />
|
||||
</KeepAlive>
|
||||
) : (
|
||||
<Component {...route.params} />
|
||||
);
|
||||
return openRouterTransition ? (
|
||||
<Transition
|
||||
{...on}
|
||||
name={route.meta.transitionName || routerTransition}
|
||||
mode="out-in"
|
||||
>
|
||||
{() => Content}
|
||||
</Transition>
|
||||
) : (
|
||||
Content
|
||||
);
|
||||
},
|
||||
}}
|
||||
</RouterView>,
|
||||
];
|
||||
);
|
||||
return openRouterTransition ? (
|
||||
<Transition
|
||||
{...on}
|
||||
name={route.meta.transitionName || routerTransition}
|
||||
mode="out-in"
|
||||
>
|
||||
{() => Content}
|
||||
</Transition>
|
||||
) : (
|
||||
Content
|
||||
);
|
||||
},
|
||||
}}
|
||||
</RouterView>
|
||||
{projectSetting.canEmbedIFramePage && <FrameLayout />}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
},
|
||||
});
|
||||
|
@@ -23,6 +23,7 @@ export default {
|
||||
meta: {
|
||||
frameSrc: 'https://2x.antdv.com/docs/vue/introduce-cn/',
|
||||
title: 'antVue文档(内嵌)',
|
||||
afterCloseLoading: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -32,6 +33,7 @@ export default {
|
||||
meta: {
|
||||
frameSrc: 'https://vvbin.cn/docs/',
|
||||
title: '项目文档(内嵌)',
|
||||
afterCloseLoading: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user