给onValidate交互事件绑定this对象。
parent
1e5038f1e7
commit
ec7921e620
|
@ -178,7 +178,7 @@ Github仓库:<a href="https://github.com/vform666/variant-form" target="_blank
|
||||||
|
|
||||||
VS Code插件:<a href="https://www.vform666.com/pages/plugin/" target="_blank">https://www.vform666.com/pages/plugin/</a>
|
VS Code插件:<a href="https://www.vform666.com/pages/plugin/" target="_blank">https://www.vform666.com/pages/plugin/</a>
|
||||||
|
|
||||||
更新日志:<a href="https://www.vform666.com/pages/changelog/" target="_blank">https://www.vform666.com/pages/changelog/</a>
|
更新日志:<a href="https://www.vform666.com/changelog.html" target="_blank">https://www.vform666.com/changelog.html</a>
|
||||||
|
|
||||||
技术交流群:微信搜索“vformAdmin”,或者扫如下二维码加群
|
技术交流群:微信搜索“vformAdmin”,或者扫如下二维码加群
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,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