Skip to content

Commit 4c7cc51

Browse files
feat(lib): 支持配置 formProps.popover 透传给ui组件 popover
re #269
1 parent f466120 commit 4c7cc51

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

packages/docs/docs/zh/guide/basic-config.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,7 @@ schema = {
789789
* 类型:`object`
790790
`form-props` 支持如下两部分参数:
791791

792-
* 固定参数部分
793-
794-
和当前使用的ui库无关
792+
1. 固定参数部分 (这部分参数和当前使用的ui库无关)
795793
```js
796794
// 默认值
797795
formProps = {
@@ -802,11 +800,12 @@ formProps = {
802800
labelPosition: 'top', // 表单域标签的位置
803801
isMiniDes: false, // 是否优先mini形式显示描述信息(label文字和描述信息同行显示)
804802
defaultSelectFirstOption: true, // 单选框必填,是否默认选中第一个
803+
popover: {}, // 透传给ui 组件库的popver组件,比如element ui Popover,antd a-popover
805804
}
806805
```
807806

808-
* 当前ui库form组件的参数
809-
如上固定参数以外的参数,都会传给当前ui库的form组件,比如elementUi el-form、IView i-form ...
807+
2. 当前ui库form组件的参数
808+
如上固定参数以外的参数,都会透传给当前ui库的form组件,比如elementUi el-form、IView i-form ...
810809
```js
811810
formProps = {
812811
layoutColumn: 2, // 1 2 3 ,支持 1 2 3 列布局,如果使用inline表单这里配置无效

packages/lib/vue2/vue2-core/src/components/Widget.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ export default {
202202
},
203203
props: {
204204
placement: 'top',
205-
trigger: 'hover'
205+
trigger: 'hover',
206+
...self.formProps?.popover
206207
}
207208
}, [
208209
descriptionVNode,

packages/lib/vue2/vue2-core/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export default function createForm(globalOptions = {}) {
142142

143143
const {
144144
// eslint-disable-next-line no-unused-vars
145-
layoutColumn = 1, inlineFooter, labelSuffix, isMiniDes, defaultSelectFirstOption, ...uiFormProps
145+
layoutColumn = 1, inlineFooter, labelSuffix, isMiniDes, defaultSelectFirstOption, popover, ...uiFormProps
146146
} = self.$props.formProps;
147147

148148
const { inline = false, labelPosition = 'top' } = uiFormProps;

packages/lib/vue3/vue3-core/src/components/Widget.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ export default {
198198
cursor: 'pointer'
199199
},
200200
placement: 'top',
201-
trigger: 'hover'
201+
trigger: 'hover',
202+
...props.formProps?.popover
202203
}, {
203204
default: () => descriptionVNode,
204205
reference: () => h(IconQuestion)

packages/lib/vue3/vue3-core/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export default function createForm(globalOptions = {}) {
142142
return () => {
143143
const {
144144
// eslint-disable-next-line no-unused-vars
145-
layoutColumn = 1, inlineFooter, labelSuffix, isMiniDes, defaultSelectFirstOption, ...uiFormProps
145+
layoutColumn = 1, inlineFooter, labelSuffix, isMiniDes, defaultSelectFirstOption, popover, ...uiFormProps
146146
} = props.formProps;
147147

148148
const { inline = false, labelPosition = 'top' } = uiFormProps;

0 commit comments

Comments
 (0)