Unverified Commit cdfcebd2 authored by Sendya's avatar Sendya

fix: fixedHeader not work state

parent 727b17f9
......@@ -29,7 +29,7 @@ const BasicLayout = defineComponent({
const [RouteContextProvider] = createRouteContext();
const menuData = getMenuData(getRoutes());
globalState.menuData = menuData;
state.menuData = menuData;
const updateSelectedMenu = () => {
const matched = route.matched.concat().map(item => item.path);
......@@ -65,12 +65,9 @@ const BasicLayout = defineComponent({
return () => (
<RouteContextProvider value={state}>
<ProLayout
i18n={(key: string) => key}
layout={state.layout}
navTheme={state.navTheme}
i18n={(key: string) => key}
isMobile={state.isMobile}
fixSiderbar={state.fixSiderbar}
fixedHeader={state.fixedHeader}
contentWidth={'Fixed'}
primaryColor={'#1890ff'}
contentStyle={{ minHeight: '300px' }}
......
......@@ -71,7 +71,9 @@ export const HeaderView = defineComponent({
onCollapse,
} = toRefs(props);
const context = useRouteContext();
const needFixedHeader = computed(() => fixedHeader.value || layout.value === 'mix');
const needFixedHeader = computed(
() => fixedHeader.value || context.fixedHeader || layout.value === 'mix',
);
const isTop = computed(() => layout.value === 'top');
const needSettingWidth = computed(
() => needFixedHeader.value && hasSiderMenu.value && !isTop.value && !isMobile.value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment