From a06f1567dbd5c0818d11bd3a2749ccd07cf5fc92 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 14 Aug 2022 09:53:38 +0800 Subject: [PATCH] docs(Form): fix the type of rule trigger option (#10912) * docs(Form): fix the type of rule trigger option * docs: update --- packages/vant/src/form/README.md | 2 +- packages/vant/src/form/README.zh-CN.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/vant/src/form/README.md b/packages/vant/src/form/README.md index be371c514..4fc9cd3c8 100644 --- a/packages/vant/src/form/README.md +++ b/packages/vant/src/form/README.md @@ -515,7 +515,7 @@ export default { | message | Error message | _string \| (value, rule) => string_ | | validator | Custom validator | _(value, rule) => boolean \| string \| Promise_ | | pattern | Regex pattern | _RegExp_ | -| trigger | When to validate the form, can be set to `onChange`、`onBlur` | _string_ | +| trigger | When to validate the form, priority is higher than the `validate-trigger` of the Form component, can be set to `onChange`, `onBlur`, `onSubmit` | _string \| string[]_ | | formatter | Format value before validate | _(value, rule) => any_ | ### validate-trigger diff --git a/packages/vant/src/form/README.zh-CN.md b/packages/vant/src/form/README.zh-CN.md index dac3ced29..6b7c0b8ef 100644 --- a/packages/vant/src/form/README.zh-CN.md +++ b/packages/vant/src/form/README.zh-CN.md @@ -543,7 +543,7 @@ export default { ### Rule 数据结构 -使用 Field 的`rules`属性可以定义校验规则,可选属性如下: +使用 Field 的 `rules` 属性可以定义校验规则,可选属性如下: | 键名 | 说明 | 类型 | | --- | --- | --- | @@ -551,7 +551,7 @@ export default { | message | 错误提示文案 | _string \| (value, rule) => string_ | | validator | 通过函数进行校验 | _(value, rule) => boolean \| string \| Promise_ | | pattern | 通过正则表达式进行校验 | _RegExp_ | -| trigger | 本项规则的触发时机,可选值为 `onChange`、`onBlur` | _string_ | +| trigger | 设置本项规则的触发时机,优先级高于 Form 组件设置的 `validate-trigger` 属性,可选值为 `onChange`、`onBlur`、`onSubmit` | _string \| string[]_ | | formatter | 格式化函数,将表单项的值转换后进行校验 | _(value, rule) => any_ | ### validate-trigger 可选值