Skip to content

refactor(Form): 重构form表单校验功能 #190

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

Closed
wants to merge 46 commits into from

Conversation

AlanLee97
Copy link
Collaborator

refactor:

  1. 重构了模板驱动校验的校验功能
  • 指令v-d-validate-rules改为v-d-validate;
  • 模板驱动校验使用v-d-validate校验功能时不再依赖于d-form组件(上一版的校验需依赖d-form组件)
  • 将校验功能抽成use-validate
  1. 重构了响应式表单的校验功能
  • 使用watch直接监听dFormData的变化,进行表单域校验(这样可以不用侵入其他表单类组件去写form组件的相关代码)

fix:

  1. 增加css样式的devui-前缀

docs:

  1. 重构表单校验后,调整文档,部分demo做了调整

AlanLee97 and others added 30 commits December 31, 2021 09:25
@kagol
Copy link
Member

kagol commented Feb 9, 2022

@AlanLee97 这波重构是真的强!

@kagol kagol added the enhancement Feature enhancement label Feb 9, 2022
@AlanLee97
Copy link
Collaborator Author

@AlanLee97 这波重构是真的强!

抱歉,kagol哥,又一次性提交这么多代码🤣(我是想着把这个功能完成一起提交PR)

@kagol
Copy link
Member

kagol commented Feb 11, 2022

@AlanLee97 这波重构是真的强!

抱歉,kagol哥,又一次性提交这么多代码🤣(我是想着把这个功能完成一起提交PR)

@AlanLee97 建议将这个PR按照重构的模块进行拆分,保持PR的粒度在100行代码左右,每个PR都是MVP。拆分PR的过程也是学习编写高质量、可读代码的过程,欢迎一起讨论~
可以从简单的开始拆分,比如改名字那个,然后逐步增加其他内容,每个都是一个独立的分支、独立的模块、独立的文件、独立的PR。

@AlanLee97 AlanLee97 closed this Feb 17, 2022
@kagol
Copy link
Member

kagol commented Feb 24, 2022

@all-contributors please add @AlanLee97 for code

@allcontributors
Copy link
Contributor

@kagol

I've put up a pull request to add @AlanLee97! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants