jd-opensource / drip-form

基于React和JSONSchema的动态表单解决方案
https://jd-opensource.github.io/drip-form/
MIT License
613 stars 73 forks source link

当unitedSchema全局validateTIme为submit或click时,表单校验字段不显示 #189

Closed cyue177 closed 2 years ago

cyue177 commented 2 years ago

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

Steps to reproduce

  1. 同上

Current behavior

同上

Expected behavior

Your environment

Reproducible demo

No response

Self-service

mengshang918 commented 2 years ago

首先,DripForm除了自定义校验部分(onValidate)是手动控制的,ajv校验(内置的关键字校验)都是实时校验的。validateTime提供的配置只是用来展示错误和不展示错误。当validateTimechange时,错误信息会直接展示。为submit或其他字段时,错误不会展示。

  1. validateTime设置为submit,有以下几种使用方法
  1. onValidate type为click时,按钮的disabled状态由当前表单的错误信息控制,有错误就会disabled。如果是异步校验,确实不合理。对于ajv校验是合理的

    我理解如果是按钮置灰可以分几种情况:

    • 同时存在ajv内置校验错误和自定义校验错误 解决ajv错误之后,按钮立即撤销置灰
    • 只存在ajv内置校验错误 只有解决错误之后,按钮才撤销置灰
    • 只存在自定义错误 变更数据,按钮撤销置灰
  2. 文档完善问题,可在#65 中讨论希望完善的文档 DripForm在v0.8.0发布之后,会对文档进行重构并完善测试用例

cyue177 commented 2 years ago

form自带的footer按钮怎么使用?怎么配置按钮才会展示?

mengshang918 commented 2 years ago

form自带的footer按钮怎么使用?怎么配置按钮才会展示?

可以在generator中全局有个底部按钮进行配置。 image

github-actions[bot] commented 2 years ago

This issue has been automatically marked as no-issue-activity because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.