From 1c617bf0260c2cbc0c6350d5e143507ba41383a5 Mon Sep 17 00:00:00 2001 From: manzhenhua Date: Fri, 1 Nov 2019 10:47:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E5=8D=95pase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index 6bd9305..3932580 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 }) } -- 2.21.0