Commit 1cbb2b33 authored by 言肆's avatar 言肆

Revert "fix: runtimeSideWidth undefined"

This reverts commit 534fd82b.
parent 534fd82b
...@@ -46,7 +46,6 @@ export interface RouteContextProps extends Partial<PureSettings>, MenuState { ...@@ -46,7 +46,6 @@ export interface RouteContextProps extends Partial<PureSettings>, MenuState {
hasFooterToolbar?: boolean; hasFooterToolbar?: boolean;
hasFooter?: boolean; hasFooter?: boolean;
setHasFooterToolbar?: (bool: boolean) => void; setHasFooterToolbar?: (bool: boolean) => void;
collapsedWidth?: number;
/* 附加属性 */ /* 附加属性 */
[key: string]: any; [key: string]: any;
} }
......
...@@ -92,6 +92,7 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) = ...@@ -92,6 +92,7 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) =
onOpenKeys, onOpenKeys,
onSelect, onSelect,
breakpoint, breakpoint,
collapsedWidth = 48,
menuExtraRender = false, menuExtraRender = false,
menuContentRender = false, menuContentRender = false,
menuFooterRender = false, menuFooterRender = false,
...@@ -100,11 +101,13 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) = ...@@ -100,11 +101,13 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) =
const { getPrefixCls } = useProProvider(); const { getPrefixCls } = useProProvider();
const context = useRouteContext(); const context = useRouteContext();
const baseClassName = getPrefixCls('sider'); const baseClassName = getPrefixCls('sider');
const collapsedWidth = context.collapsedWidth || 48;
// const isMix = computed(() => props.layout === 'mix'); // const isMix = computed(() => props.layout === 'mix');
// const fixed = computed(() => context.fixSiderbar); // const fixed = computed(() => context.fixSiderbar);
const runtimeTheme = computed(() => (props.layout === 'mix' && 'light') || props.navTheme); const runtimeTheme = computed(() => (props.layout === 'mix' && 'light') || props.navTheme);
const runtimeSideWidth = computed(() => (props.collapsed ? collapsedWidth : siderWidth)); const runtimeSideWidth = computed(() =>
props.collapsed ? props.collapsedWidth : props.siderWidth,
);
const classNames = computed(() => { const classNames = computed(() => {
return { return {
...@@ -174,7 +177,6 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) = ...@@ -174,7 +177,6 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) =
<div style="flex: 1; overflow: hidden auto;"> <div style="flex: 1; overflow: hidden auto;">
{(menuContentRender && menuContentRender(props, defaultMenuDom)) || defaultMenuDom} {(menuContentRender && menuContentRender(props, defaultMenuDom)) || defaultMenuDom}
</div> </div>
{!context.isMobile && (
<div class={`${baseClassName}-links`}> <div class={`${baseClassName}-links`}>
<Menu <Menu
class={`${baseClassName}-link-menu`} class={`${baseClassName}-link-menu`}
...@@ -198,7 +200,6 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) = ...@@ -198,7 +200,6 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) =
</Menu.Item> </Menu.Item>
</Menu> </Menu>
</div> </div>
)}
{menuFooterRender && <div class={`${baseClassName}-footer`}>{menuFooterRender(props)}</div>} {menuFooterRender && <div class={`${baseClassName}-footer`}>{menuFooterRender(props)}</div>}
</Sider> </Sider>
</> </>
......
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