Commit ad8b26d8 authored by 满振华's avatar 满振华

修改变淡

parent 3401d54c
Pipeline #6009 canceled with stages
{
"name": "apollo_form_pase",
"version": "0.0.3",
"version": "0.0.4",
"description": "",
"main": "dist/index.js",
"module": "dist/index.esm.js",
......
import { HandleClass } from './behavior';
class HandleBehavior {
constructor(props) {
this.formData = null;
this.formData = props.formData || null;
}
initBehavior = (formData) => {
if (!this.formData) {
this.formData = formData
}
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);
......@@ -16,7 +17,6 @@ class HandleBehavior {
return this;
}
getFormData = () => {
return this.formData
}
......@@ -60,5 +60,8 @@ class HandleBehavior {
const componentData = this.formData.find(ls => ls.name === key) || {};
this.handleBehavior({ currentValue: value, componentData })
}
hiddenFilds = () => {
this.formData = this.formData.filter(item => item.type !== 'hidden')
}
}
export default HandleBehavior
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment