From a5a9b3fb34c64b6ea9c9ab3d58045f6e5963952b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=9C=A8?= Date: Sat, 24 Jul 2021 14:48:09 +0800 Subject: [PATCH] fix(table): fix `dataPicker` show in `fullscreen` mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复basicTable编辑组件的校验提示以及日期选择框的弹出层在全屏模式下的显示问题 --- .../src/components/editable/CellComponent.ts | 15 +++++++++++++-- .../src/components/editable/EditableCell.vue | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/Table/src/components/editable/CellComponent.ts b/src/components/Table/src/components/editable/CellComponent.ts index 897954f0a49..231f3256cb2 100644 --- a/src/components/Table/src/components/editable/CellComponent.ts +++ b/src/components/Table/src/components/editable/CellComponent.ts @@ -10,10 +10,17 @@ export interface ComponentProps { rule: boolean; popoverVisible: boolean; ruleMessage: string; + getPopupContainer?: Fn; } export const CellComponent: FunctionalComponent = ( - { component = 'Input', rule = true, ruleMessage, popoverVisible }: ComponentProps, + { + component = 'Input', + rule = true, + ruleMessage, + popoverVisible, + getPopupContainer, + }: ComponentProps, { attrs } ) => { const Comp = componentMap.get(component) as typeof defineComponent; @@ -24,7 +31,11 @@ export const CellComponent: FunctionalComponent = ( } return h( Popover, - { overlayClassName: 'edit-cell-rule-popover', visible: !!popoverVisible }, + { + overlayClassName: 'edit-cell-rule-popover', + visible: !!popoverVisible, + ...(getPopupContainer ? { getPopupContainer } : {}), + }, { default: () => DefaultComp, content: () => ruleMessage, diff --git a/src/components/Table/src/components/editable/EditableCell.vue b/src/components/Table/src/components/editable/EditableCell.vue index f8f648ea927..15bcf505a35 100644 --- a/src/components/Table/src/components/editable/EditableCell.vue +++ b/src/components/Table/src/components/editable/EditableCell.vue @@ -114,6 +114,7 @@ return { getPopupContainer: () => unref(table?.wrapRef.value) ?? document.body, + getCalendarContainer: () => unref(table?.wrapRef.value) ?? document.body, placeholder: createPlaceholderMessage(unref(getComponent)), ...apiSelectProps, ...omit(compProps, 'onChange'),