Unverified Commit cdfcebd2 authored by Sendya's avatar Sendya

fix: fixedHeader not work state

parent 727b17f9
...@@ -29,7 +29,7 @@ const BasicLayout = defineComponent({ ...@@ -29,7 +29,7 @@ const BasicLayout = defineComponent({
const [RouteContextProvider] = createRouteContext(); const [RouteContextProvider] = createRouteContext();
const menuData = getMenuData(getRoutes()); const menuData = getMenuData(getRoutes());
globalState.menuData = menuData; state.menuData = menuData;
const updateSelectedMenu = () => { const updateSelectedMenu = () => {
const matched = route.matched.concat().map(item => item.path); const matched = route.matched.concat().map(item => item.path);
...@@ -65,12 +65,9 @@ const BasicLayout = defineComponent({ ...@@ -65,12 +65,9 @@ const BasicLayout = defineComponent({
return () => ( return () => (
<RouteContextProvider value={state}> <RouteContextProvider value={state}>
<ProLayout <ProLayout
i18n={(key: string) => key}
layout={state.layout} layout={state.layout}
navTheme={state.navTheme} navTheme={state.navTheme}
i18n={(key: string) => key}
isMobile={state.isMobile}
fixSiderbar={state.fixSiderbar}
fixedHeader={state.fixedHeader}
contentWidth={'Fixed'} contentWidth={'Fixed'}
primaryColor={'#1890ff'} primaryColor={'#1890ff'}
contentStyle={{ minHeight: '300px' }} contentStyle={{ minHeight: '300px' }}
......
...@@ -71,7 +71,9 @@ export const HeaderView = defineComponent({ ...@@ -71,7 +71,9 @@ export const HeaderView = defineComponent({
onCollapse, onCollapse,
} = toRefs(props); } = toRefs(props);
const context = useRouteContext(); 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 isTop = computed(() => layout.value === 'top');
const needSettingWidth = computed( const needSettingWidth = computed(
() => needFixedHeader.value && hasSiderMenu.value && !isTop.value && !isMobile.value, () => 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