Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'click': () => {
const fApi = this.$handle.fCreateApi;
isFunction(submitBtn.click)
? submitBtn.click(fApi)
: fApi.submit();
}
}
'click': () => {
const fApi = this.fc.fCreateApi;
isFunction(submitBtn.click)
? submitBtn.click(fApi)
: fApi.submit();
}
}
renderTemplate(parser) {
const {id, rule, key} = parser;
if (Vue.compile === undefined) {
console.error('使用的 Vue 版本不支持 compile' + errMsg());
return [];
}
if (!this.renderList[id]) {
let vm = rule.vm;
if (isUndef(rule.vm))
vm = new Vue;
else if (isFunction(rule.vm))
vm = rule.vm(this.$handle.getInjectData(rule));
this.renderList[id] = {
vm,
template: Vue.compile(rule.template)
};
}
const {vm, template} = this.renderList[id];
setTemplateProps(vm, parser, this.$handle.fCreateApi);
vm.$off('input');
vm.$on('input', (value) => {
this.onInput(parser, value);
this.validate(() => {
let formData = this.formData();
if (isFunction(successFn))
successFn(formData, this);
else
fc.options.onSubmit && fc.options.onSubmit(formData);
}, () => failFn && failFn());
},
sync(event) {
if (isFunction(event))
this.$tickEvent.push(event);
this.clearCache();
this.vm._sync();
}
function parseVData(data) {
if (isString(data))
data = {domProps: {innerHTML: data}};
else if (data && isFunction(data.get))
data = data.get();
return data;
}
export function getRule(rule) {
if (isFunction(rule.getRule))
return rule.getRule();
else
return rule;
}
Object.keys(on).forEach(k => {
if (isFunction(on[k]))
on[k] = this.inject(rule, on[k])
});
return on;