From ec7921e620efac39281b24b4d04e61a5b56b15a3 Mon Sep 17 00:00:00 2001 From: vdpAdmin Date: Thu, 21 Apr 2022 18:04:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99onValidate=E4=BA=A4=E4=BA=92=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=BB=91=E5=AE=9Athis=E5=AF=B9=E8=B1=A1=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- .../form-designer/form-widget/field-widget/fieldMixin.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 096fdb3..5f34e47 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ Github仓库:https://www.vform666.com/pages/plugin/ -更新日志:https://www.vform666.com/pages/changelog/ +更新日志:https://www.vform666.com/changelog.html 技术交流群:微信搜索“vformAdmin”,或者扫如下二维码加群 diff --git a/src/components/form-designer/form-widget/field-widget/fieldMixin.js b/src/components/form-designer/form-widget/field-widget/fieldMixin.js index b6a843f..8f5a6c8 100644 --- a/src/components/form-designer/form-widget/field-widget/fieldMixin.js +++ b/src/components/form-designer/form-widget/field-widget/fieldMixin.js @@ -224,7 +224,10 @@ export default { } if (!!this.field.options.onValidate) { - let customFn = new Function('rule', 'value', 'callback', this.field.options.onValidate) + let customFn = (rule, value, callback) => { + let tmpFunc = new Function('rule', 'value', 'callback', this.field.options.onValidate) + return tmpFunc.call(this, rule, value, callback) + } this.rules.push({ validator: customFn, trigger: ['blur', 'change'],