Commit 500a5ea9 authored by eth3lbert's avatar eth3lbert Committed by 言肆

fix(FooterToolbar): keep reactivity of class name

parent d674db62
...@@ -34,8 +34,10 @@ const FooterToolbar = defineComponent({ ...@@ -34,8 +34,10 @@ const FooterToolbar = defineComponent({
setup(props, { slots }) { setup(props, { slots }) {
const { getPrefixCls } = inject(injectProConfigKey, defaultProProviderProps); const { getPrefixCls } = inject(injectProConfigKey, defaultProProviderProps);
const baseClassName = computed(() => {
const prefixCls = props.prefixCls || getPrefixCls(); const prefixCls = props.prefixCls || getPrefixCls();
const baseClassName = `${prefixCls}-footer-bar`; return `${prefixCls}-footer-bar`;
});
const routeContext = useRouteContext(); const routeContext = useRouteContext();
const width = computed(() => { const width = computed(() => {
const { hasSideMenu, isMobile, sideWidth } = routeContext; const { hasSideMenu, isMobile, sideWidth } = routeContext;
...@@ -51,8 +53,8 @@ const FooterToolbar = defineComponent({ ...@@ -51,8 +53,8 @@ const FooterToolbar = defineComponent({
const dom = () => { const dom = () => {
return ( return (
<> <>
<div class={`${baseClassName}-left`}>{props.extra}</div> <div class={`${baseClassName.value}-left`}>{props.extra}</div>
<div class={`${baseClassName}-right`}>{slots.default()}</div> <div class={`${baseClassName.value}-right`}>{slots.default()}</div>
</> </>
); );
}; };
...@@ -64,7 +66,7 @@ const FooterToolbar = defineComponent({ ...@@ -64,7 +66,7 @@ const FooterToolbar = defineComponent({
}); });
return () => ( return () => (
<div class={baseClassName} style={{ width: width.value }}> <div class={baseClassName.value} style={{ width: width.value }}>
{props.renderContent {props.renderContent
? props.renderContent( ? props.renderContent(
{ {
......
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