From 4c7cc51c7c094e6280b3bcd9b3164dac075de6f1 Mon Sep 17 00:00:00 2001 From: Jino Liu Date: Mon, 1 May 2023 14:59:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(lib):=20=E6=94=AF=E6=8C=81=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=20formProps.popover=20=E9=80=8F=E4=BC=A0=E7=BB=99ui?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=20popover?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit re #269 --- packages/docs/docs/zh/guide/basic-config.md | 9 ++++----- packages/lib/vue2/vue2-core/src/components/Widget.js | 3 ++- packages/lib/vue2/vue2-core/src/index.js | 2 +- packages/lib/vue3/vue3-core/src/components/Widget.js | 3 ++- packages/lib/vue3/vue3-core/src/index.js | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/docs/docs/zh/guide/basic-config.md b/packages/docs/docs/zh/guide/basic-config.md index a2c5fd35..fd636d56 100644 --- a/packages/docs/docs/zh/guide/basic-config.md +++ b/packages/docs/docs/zh/guide/basic-config.md @@ -789,9 +789,7 @@ schema = { * 类型:`object` `form-props` 支持如下两部分参数: -* 固定参数部分 - -和当前使用的ui库无关 +1. 固定参数部分 (这部分参数和当前使用的ui库无关) ```js // 默认值 formProps = { @@ -802,11 +800,12 @@ formProps = { labelPosition: 'top', // 表单域标签的位置 isMiniDes: false, // 是否优先mini形式显示描述信息(label文字和描述信息同行显示) defaultSelectFirstOption: true, // 单选框必填,是否默认选中第一个 + popover: {}, // 透传给ui 组件库的popver组件,比如element ui Popover,antd a-popover } ``` -* 当前ui库form组件的参数 -如上固定参数以外的参数,都会传给当前ui库的form组件,比如elementUi el-form、IView i-form ... +2. 当前ui库form组件的参数 +如上固定参数以外的参数,都会透传给当前ui库的form组件,比如elementUi el-form、IView i-form ... ```js formProps = { layoutColumn: 2, // 1 2 3 ,支持 1 2 3 列布局,如果使用inline表单这里配置无效 diff --git a/packages/lib/vue2/vue2-core/src/components/Widget.js b/packages/lib/vue2/vue2-core/src/components/Widget.js index 0b966e64..97857da4 100644 --- a/packages/lib/vue2/vue2-core/src/components/Widget.js +++ b/packages/lib/vue2/vue2-core/src/components/Widget.js @@ -202,7 +202,8 @@ export default { }, props: { placement: 'top', - trigger: 'hover' + trigger: 'hover', + ...self.formProps?.popover } }, [ descriptionVNode, diff --git a/packages/lib/vue2/vue2-core/src/index.js b/packages/lib/vue2/vue2-core/src/index.js index b50b227a..857abd82 100644 --- a/packages/lib/vue2/vue2-core/src/index.js +++ b/packages/lib/vue2/vue2-core/src/index.js @@ -142,7 +142,7 @@ export default function createForm(globalOptions = {}) { const { // eslint-disable-next-line no-unused-vars - layoutColumn = 1, inlineFooter, labelSuffix, isMiniDes, defaultSelectFirstOption, ...uiFormProps + layoutColumn = 1, inlineFooter, labelSuffix, isMiniDes, defaultSelectFirstOption, popover, ...uiFormProps } = self.$props.formProps; const { inline = false, labelPosition = 'top' } = uiFormProps; diff --git a/packages/lib/vue3/vue3-core/src/components/Widget.js b/packages/lib/vue3/vue3-core/src/components/Widget.js index 0ad44eeb..9d2bf7fb 100644 --- a/packages/lib/vue3/vue3-core/src/components/Widget.js +++ b/packages/lib/vue3/vue3-core/src/components/Widget.js @@ -198,7 +198,8 @@ export default { cursor: 'pointer' }, placement: 'top', - trigger: 'hover' + trigger: 'hover', + ...props.formProps?.popover }, { default: () => descriptionVNode, reference: () => h(IconQuestion) diff --git a/packages/lib/vue3/vue3-core/src/index.js b/packages/lib/vue3/vue3-core/src/index.js index a4baf37a..817fe68c 100644 --- a/packages/lib/vue3/vue3-core/src/index.js +++ b/packages/lib/vue3/vue3-core/src/index.js @@ -142,7 +142,7 @@ export default function createForm(globalOptions = {}) { return () => { const { // eslint-disable-next-line no-unused-vars - layoutColumn = 1, inlineFooter, labelSuffix, isMiniDes, defaultSelectFirstOption, ...uiFormProps + layoutColumn = 1, inlineFooter, labelSuffix, isMiniDes, defaultSelectFirstOption, popover, ...uiFormProps } = props.formProps; const { inline = false, labelPosition = 'top' } = uiFormProps;