Skip to content

Commit

Permalink
feat(form): support require-mark-placement(tusen-ai#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
doom-9 committed Jun 18, 2021
1 parent 142ffa2 commit cedb92f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

### Feats

- `n-form`, `n-form-item` add require-mark-placement prop,closes [#171](https://github.com/TuSimple/naive-ui/issues/171)

### Feats

- `n-dropdown` support class attr, closes [#180](https://github.com/TuSimple/naive-ui/issues/180).

## 2.12.0 (2020-06-16)
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Feats

- `n-form`,`n-form-item` 新增 require-mark-placement 属性,关闭 [#171](https://github.com/TuSimple/naive-ui/issues/171)
- `n-form`, `n-form-item` 新增 require-mark-placement 属性,关闭 [#171](https://github.com/TuSimple/naive-ui/issues/171)

### Feats

Expand Down
4 changes: 2 additions & 2 deletions src/form/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async
| model | `Object` | `{}` | The object to get collected value from form items. |
| rules | `type FormRules = { [itemValidatePath: string]: FormItemRule \| Array<FormItemRule> \| FormRules }` | `{}` | The rules to validate form items. |
| show-feedback | `boolean` | `true` | |
| show-require-mark | `boolean` | `true` | Whether to show require mark when form item is required. |
| show-require-mark | `'left' \| 'right' \| 'boolean'` | `right` | Whether to show require mark when form item is required. |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | |

#### FormItemRule Type
Expand Down Expand Up @@ -59,7 +59,7 @@ async
| rule | `FormItemRule \| Array<FormItemRule>` | `undefined` | The rule to validate the form item. It will be merged with the rules acquired by `rule-path` from wrapper form's rules. It's recommend to set all rules on wrapper form. |
| rule-path | `string` | `undefined` | The path to get rule from wrapper form's rule object. If not set, use path of the form item instead. |
| show-feedback | `boolean` | `true` | |
| show-require-mark | `boolean` | `true` | Whether to show require mark. If not set, use `show-require-mark` from wrapper form. |
| show-require-mark | `'left' \| 'right' \| 'boolean'` | `right` | Whether to show require mark. If not set, use `show-require-mark` from wrapper form. |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | |
| validation-status | `'error' \| 'success' \| 'warning'` | `undefined` | The validation status of the form item. If not set to `undefined`, it will take place of the result of rule-based validation. |

Expand Down
4 changes: 2 additions & 2 deletions src/form/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ validator-debug
| model | `Object` | `{}` | 获取表项中收集到的值的对象 |
| rules | `type FormRules = { [itemValidatePath: string]: FormItemRule \| Array<FormItemRule> \| FormRules }` | `{}` | 验证表项的规则 |
| show-feedback | `boolean` | `true` | |
| show-require-mark | `'left' \| 'right' \| 'boolen'` | `right` | 是否展示必填的星号 |
| show-require-mark | `'left' \| 'right' \| 'boolean'` | `right` | 是否展示必填的星号 |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | |

#### FormItemRule Type
Expand Down Expand Up @@ -60,7 +60,7 @@ validator-debug
| rule | `FormItemRule \| Array<FormItemRule>` | `undefined` | 验证表项的规则,它会被通过 `rule-path` 从外层表单获取的规则合并来作为表项的验证规则。推荐还是在外层表单设置所有规则 |
| rule-path | `string` | `undefined` | 从外层表单的 `rules` 对象获取规则的路径。如果没有设定,使用表项的 `path` 代替 |
| show-feedback | `boolean` | `true` | |
| show-require-mark | `'left' \| 'right' \| 'boolen'` | `right` | 是否展示必填的星号。如果没有被设定,使用外层 `n-form``show-require-mark` |
| show-require-mark | `'left' \| 'right' \| 'boolean'` | `right` | 是否展示必填的星号。如果没有被设定,使用外层 `n-form``show-require-mark` |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | |
| validation-status | `'error' \| 'success' \| 'warning'` | `undefined` | 表单的验证状态。不设为 `undefined`时,会覆盖规则验证的结果 |

Expand Down

0 comments on commit cedb92f

Please sign in to comment.