-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: form #1118
refactor: form #1118
Conversation
# Conflicts: # src/packages/picker/picker.taro.tsx # src/packages/picker/picker.tsx
Codecov Report
@@ Coverage Diff @@
## next #1118 +/- ##
==========================================
+ Coverage 70.27% 70.74% +0.46%
==========================================
Files 187 194 +7
Lines 7579 7796 +217
Branches 2184 2231 +47
==========================================
+ Hits 5326 5515 +189
- Misses 2043 2069 +26
- Partials 210 212 +2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- from v1 文档更新
- formitem config.json 中更新到2.0.0,及支持 taro
- demo 支持多语言
- demo 联系电话的placeholder 可改为 请输入电话号码
- demo picker 可以给一下> 箭头标识,使其看起来可点击
- demo 保持多语言一致性
- demo 基础用法,点击提交,无反馈
- demo 表单类型模块,可以直接提交,且能通过校验;删除uploader 的图片,点击重置,无法重置;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
组件内console 注意移除。
@@ -442,14 +442,14 @@ | |||
"author": "dsj" | |||
}, | |||
{ | |||
"version": "1.0.0", | |||
"version": "2.0.0", | |||
"name": "Form", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FormItem 需要处理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
src/packages/form/doc.en-US.md
Outdated
::: | ||
|
||
### Top Align | ||
### form validation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
大写
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
src/packages/form/doc.en-US.md
Outdated
### Props | ||
|
||
| Property | Description | Type | Default | | ||
|----------------|--------------|-----------|---| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
数据类型 ``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
src/packages/form/doc.md
Outdated
| form | 经 Form.useForm() 创建的 form 控制实例,不提供时会自动创建 | `FormInstance` | `-` | | ||
| footer | 表单底部区域,一般放置确认和重置按钮 | `ReactNode` | `null` | | ||
| initialValues | 表单初始值 | `any` | `-` | | ||
| name | 表单名称 | `any` | `\` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\
改为 -
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
| max | 必须设置 type:string 类型为字符串最大长度;number 类型时为最大值;array 类型时为数组最大长度 | `number` | | ||
| min | 必须设置 type:string 类型为字符串最小长度;number 类型时为最小值;array 类型时为数组最小长度 | `number` | | ||
| pattern | 正则表达式匹配 | `number` | | ||
| pattern | 正则表达式匹配 | `RegExp` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两个什么区别?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
复制错了,已删除
src/packages/form/doc.md
Outdated
| 属性 | 说明 | 类型 | | ||
|----------------| --- | --- | | ||
| getFieldValue | 获取对应字段名的值 | (name: NamePath) => any | | ||
| setFieldsValue | 设置表单的值 | (values) => void | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get 和 set 是不是要成对,可都支持单个和多个。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之后版本逐步扩充功能
src/packages/form/doc.md
Outdated
|
||
| 属性 | 说明 | 类型 | | ||
|----------------| --- | --- | | ||
| getFieldValue | 获取对应字段名的值 | (name: NamePath) => any | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类型需 ``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
src/packages/form/useform.taro.ts
Outdated
@@ -46,94 +68,85 @@ class FormStore { | |||
...this.store, | |||
...newStore, | |||
} | |||
|
|||
console.log('setFieldsValue', this.store) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
移除注释
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
src/packages/form/useform.taro.ts
Outdated
|
||
this.fieldEntities.forEach((enetity: FieldEntity) => { | ||
enetity.onStoreChange() | ||
console.log('resetFields', this.store, this.initialValues) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
移除注释
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
src/packages/form/useform.ts
Outdated
submit: this.submit, | ||
store: this.store, | ||
errList: this.errList, | ||
errList: this.errors, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个为什么不能叫 errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
uploader 组件的 filelist 变化后,需要有相应的 change 触发。目前 uploader 组件内部没有触发 change |
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单