diff --git a/src/index.js b/src/index.js index 6bd9305bcfa03409146091563dc4a7a6af6e15c2..393258069cd4958019a86ed904480609f85f0563 100644 --- a/src/index.js +++ b/src/index.js @@ -9,11 +9,12 @@ class HandleBehavior { } if (!this.formData) return this.hiddenFilds(); - this.formData.map(item => { - if (!item.behaviors || !Array.isArray(item.behaviors) || item.behaviors.length === 0) return; - const value = this.handleFormaterValue(item.value, item); - this.handleBehavior({ currentValue: value, componentData: item, handleType: 'init' }) - }) + fi + // this.formData.map(item => { + // if (!item.behaviors || !Array.isArray(item.behaviors) || item.behaviors.length === 0) return; + // const value = this.handleFormaterValue(item.value, item); + // this.handleBehavior({ currentValue: value, componentData: item, handleType: 'init' }) + // }) return this; } getFormData = () => { @@ -55,9 +56,9 @@ class HandleBehavior { const behaviorInstance = HandleClass[behavior.behaviorValue]; if (!behaviorInstance || !behaviorInstance.fun) return; let formData = this.formData; - this.formData = behaviorInstance.fun({ value, behavior, behaviors, formData, componentData, handleType }, this.resertValueCallback); + this.formData = behaviorInstance.fun({ value, behavior, behaviors, formData, componentData, handleType }, this.resetValueCallback); } - resertValueCallback = ({ key, value }) => { + resetValueCallback = ({ key, value }) => { const componentData = this.formData.find(ls => ls.name === key) || {}; this.handleBehavior({ currentValue: value, componentData }) }