mirror of
https://github.com/vform666/variant-form3-vite.git
synced 2025-01-27 00:19:13 +08:00
给onValidate交互事件绑定this对象。
This commit is contained in:
parent
6d48f2271a
commit
d0948f36e5
@ -233,7 +233,10 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!!this.field.options.onValidate) {
|
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({
|
this.rules.push({
|
||||||
validator: customFn,
|
validator: customFn,
|
||||||
trigger: ['blur', 'change'],
|
trigger: ['blur', 'change'],
|
||||||
|
Loading…
Reference in New Issue
Block a user