mirror of
https://github.com/vform666/variant-form3-vite.git
synced 2024-11-10 09:39:20 +08:00
给onValidate交互事件绑定this对象。
This commit is contained in:
parent
6d48f2271a
commit
d0948f36e5
@ -233,7 +233,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'],
|
||||
|
Loading…
Reference in New Issue
Block a user