Skip to content

Commit

Permalink
feat: form组件requiredMessageCallback新增name字段名参数
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuo committed May 24, 2024
1 parent d82aff3 commit 490fe04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vantui/src/form/core/formstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const formInstanceApi = [
const isReg = (value: any) => value instanceof RegExp
class FormStore {
static instance: FormStore
public requiredMessageCallback?: (label: string) => string
public requiredMessageCallback?: (label: string, name: string) => string
public FormUpdate: () => any
public model: Record<string, any>
public control: Record<string, any>
Expand Down Expand Up @@ -365,6 +365,7 @@ class FormStore {
if (this.requiredMessageCallback) {
this.model[name].message = this.requiredMessageCallback(
this.model[name].label,
name,
)
} else {
if (this.model[name].label) {
Expand Down

0 comments on commit 490fe04

Please sign in to comment.