alibaba / formily

📱🚀 🧩 Cross Device & High Performance Normal Form/Dynamic(JSON Schema) Form/Form Builder -- Support React/React Native/Vue 2/Vue 3
https://formilyjs.org/
MIT License
10.94k stars 1.43k forks source link

[Feature Request] 期望覆盖默认的validator triggerType "onInput" #4044

Open canvascat opened 7 months ago

canvascat commented 7 months ago

What problem does this feature solve?

当我不希望任何事件会触发检验,这很有用。

现在如果我不需要默认的triggerType,我必须给每个validator都设置一个不存在的trigger

const schema: ISchema = {
  type: "object",
  properties: {
    input: {
      type: "string",
      title: "输入框",
      description: "这是一个输入框",
      "x-validator": {
        triggerType: "",
        required: true,
      },
    },
  }
}

如果我不设置 triggerType,将会在输入时触发校验

What does the proposed API look like?

/

faner11 commented 6 months ago

你别设置规则不就行了

coolbob1998 commented 6 months ago

如果是只想展示必填的星号,设置 FormItem 的属性就行了。在 schema 中就是 decoratorProps

canvascat commented 6 months ago

如果是只想展示必填的星号,设置 FormItem 的属性就行了。在 schema 中就是 decoratorProps

希望只有提交时触发校验,不希望触发trigger时触发校验😅