From bf7eabb64d8053a2619d490d98925396ce89446f Mon Sep 17 00:00:00 2001 From: Liril Date: Wed, 3 May 2017 17:51:18 +0800 Subject: [PATCH] Form: Add label slot --- examples/docs/en-US/form.md | 7 +++++++ examples/docs/zh-CN/form.md | 6 ++++++ packages/form/src/form-item.vue | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/docs/en-US/form.md b/examples/docs/en-US/form.md index 1e5e82ebb..b13a1f6f7 100644 --- a/examples/docs/en-US/form.md +++ b/examples/docs/en-US/form.md @@ -765,3 +765,10 @@ Form component allows you to verify your data, helping you find and correct erro | rules | validation rules of form | object | — | — | | error | field error message, set its value and the field will validate error and show this message immediately | string | — | — | | show-message | whether to show the error message | boolean | — | true | + + +### Form-Item Slot +| name | Description | +|------|--------| +| — | content of Form Item | +| label | content of label | diff --git a/examples/docs/zh-CN/form.md b/examples/docs/zh-CN/form.md index ec664b219..56da589a3 100644 --- a/examples/docs/zh-CN/form.md +++ b/examples/docs/zh-CN/form.md @@ -753,3 +753,9 @@ | rules | 表单验证规则 | object | — | — | | error | 表单域验证错误信息, 设置该值会使表单验证状态变为`error`,并显示该错误信息 | string | — | — | | show-message | 是否显示校验错误信息 | boolean | — | true | + +### Form-Item Slot +| name | 说明 | +|------|--------| +| — | Form Item 的内容 | +| label | 标签文本的内容 | diff --git a/packages/form/src/form-item.vue b/packages/form/src/form-item.vue index c4d282688..74b3aba2c 100644 --- a/packages/form/src/form-item.vue +++ b/packages/form/src/form-item.vue @@ -5,7 +5,7 @@ 'is-required': isRequired || required }">