Modal控件设置 :title = null 无效,标题栏无法隐藏 #4856

pull/474/merge
zhangdaiscott 2023-05-26 11:59:01 +08:00
parent 1b4dca16ed
commit 356844e67f
1 changed files with 11 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<ModalClose :canFullscreen="getProps.canFullscreen" :fullScreen="fullScreenRef" :commentSpan="commentSpan" :enableComment="getProps.enableComment" @comment="handleComment" @cancel="handleCancel" @fullscreen="handleFullScreen" /> <ModalClose :canFullscreen="getProps.canFullscreen" :fullScreen="fullScreenRef" :commentSpan="commentSpan" :enableComment="getProps.enableComment" @comment="handleComment" @cancel="handleCancel" @fullscreen="handleFullScreen" />
</template> </template>
<template #title v-if="!$slots.title"> <template #title v-if="!isNoTitle">
<ModalHeader :helpMessage="getProps.helpMessage" :title="getMergeProps.title" @dblclick="handleTitleDbClick" /> <ModalHeader :helpMessage="getProps.helpMessage" :title="getMergeProps.title" @dblclick="handleTitleDbClick" />
</template> </template>
@ -70,7 +70,7 @@
inheritAttrs: false, inheritAttrs: false,
props: basicProps, props: basicProps,
emits: ['visible-change', 'height-change', 'cancel', 'ok', 'register', 'update:visible'], emits: ['visible-change', 'height-change', 'cancel', 'ok', 'register', 'update:visible'],
setup(props, { emit, attrs }) { setup(props, { emit, attrs , slots}) {
const visibleRef = ref(false); const visibleRef = ref(false);
const propsRef = ref<Partial<ModalProps> | null>(null); const propsRef = ref<Partial<ModalProps> | null>(null);
const modalWrapperRef = ref<any>(null); const modalWrapperRef = ref<any>(null);
@ -101,6 +101,13 @@
...(unref(propsRef) as any), ...(unref(propsRef) as any),
}; };
}); });
//update-begin-author:liusq date:2023-05-25 for:issues/4856Modal :title = null
//
const isNoTitle = computed(() => {
//
return !unref(getMergeProps).title && !slots.title;
});
//update-end-author:liusq date:2023-05-25 for:issues/4856Modal :title = null
const { handleFullScreen, getWrapClassName, fullScreenRef } = useFullScreen({ const { handleFullScreen, getWrapClassName, fullScreenRef } = useFullScreen({
modalWrapperRef, modalWrapperRef,
@ -243,7 +250,8 @@
handleTitleDbClick, handleTitleDbClick,
getWrapperHeight, getWrapperHeight,
commentSpan, commentSpan,
handleComment handleComment,
isNoTitle
}; };
}, },
}); });