-
Notifications
You must be signed in to change notification settings - Fork 141
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
[comp: form]: api design of all form components #153
Comments
danranVm
added
enhancement
New feature or request
Docs
Improvements or additions to documentation
and removed
enhancement
New feature or request
labels
Jan 20, 2021
This was referenced Jan 28, 2021
Closed
danranVm
added a commit
that referenced
this issue
Jan 28, 2021
This was referenced Feb 3, 2021
1 task
jiayinkong
added a commit
to jiayinkong/components
that referenced
this issue
Jul 25, 2021
support form control and use tsx to render comp template instead of vue file's template, meanwhile updating the style and completing the test of the comp fix IDuxFE#153
13 tasks
jiayinkong
added a commit
to jiayinkong/components
that referenced
this issue
Jul 26, 2021
support form control and use tsx to render comp template instead of vue file's template, meanwhile updating the style and completing the test of the comp fix IDuxFE#153 refactor(comp:switch): fix the review issue
danranVm
pushed a commit
that referenced
this issue
Jul 26, 2021
support form control and use tsx to render comp template instead of vue file's template, meanwhile updating the style and completing the test of the comp re #153
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have searched the issues of this repository and believe that this is not a duplicate.
所有表单组件不提供
modelValue
和update:modelValue
,根据不同的组件类型提供value
,update:value
(例如 input, textarea)checked
,update:checked
(例如 radio, checkbox)所有表单组件均需要实现 cdk 中的 forms,其实就是实现一个
control
的Props
,control
的类型为string | AbstractControl
string
, 就通过依赖注入去父级组件组件中查找,正常返回的是AbstractControl
, 如果返回异常,需要报warning
AbstractControl
干三件事AbstractControl.valueRef
绑定组件的value
input
或者change
的时候,调用一下AbstractControl.setValue
, 设置新值blur
的时候,调用一下AbstractControl.markAsBlurred
, 修改状态control
和v-model
不能共存control
的时候,用户不能再使用v-model
, 也就是说此时表单组件是全权通过AbstractControl
来控制的useValueAccessor
来处理control
和v-model
的关系,参见:feat(cdk:forms): add useValueAccessor #173control
无需单元测试,交由ix-form
和ix-form-item
组件负责相关测试。关于 cdk forms 更多细节请参考 [cdk: forms]: reactive forms system #115
针对支持 v-model 的 props 的一个 API 设计原则:
The text was updated successfully, but these errors were encountered: