update 种子深度合并
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import { Button, Tabs } from 'antd'
|
import { Button, Tabs } from 'antd'
|
||||||
import { ComponentDynamic, Container } from 'components'
|
import { ComponentDynamic, Container } from 'components'
|
||||||
import { isEqual } from 'lodash'
|
import { isEqual, merge } from 'lodash'
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{
|
{
|
||||||
@@ -57,10 +57,7 @@ export default class index extends Component {
|
|||||||
for (const child of this.children) {
|
for (const child of this.children) {
|
||||||
try {
|
try {
|
||||||
const data = await child.getData()
|
const data = await child.getData()
|
||||||
this.formData = {
|
merge(this.formData, data)
|
||||||
...this.formData,
|
|
||||||
...data,
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { Component } from 'react'
|
|||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom'
|
||||||
import { Anchor, Card, Col, Divider, Row, Spin } from 'antd'
|
import { Anchor, Card, Col, Divider, Row, Spin } from 'antd'
|
||||||
import { AntIcon, ComponentDynamic, Container } from 'components'
|
import { AntIcon, ComponentDynamic, Container } from 'components'
|
||||||
import { isEqual } from 'lodash'
|
import { isEqual, merge } from 'lodash'
|
||||||
|
|
||||||
const parts = [
|
const parts = [
|
||||||
{
|
{
|
||||||
@@ -52,10 +52,7 @@ export default class index extends Component {
|
|||||||
async getData() {
|
async getData() {
|
||||||
for (const child of this.children) {
|
for (const child of this.children) {
|
||||||
const data = await child.getData()
|
const data = await child.getData()
|
||||||
this.formData = {
|
merge(this.formData, data)
|
||||||
...this.formData,
|
|
||||||
...data,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return this.formData
|
return this.formData
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { Component } from 'react'
|
|||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom'
|
||||||
import { Anchor, Button, Card, Col, Divider, Row, Spin } from 'antd'
|
import { Anchor, Button, Card, Col, Divider, Row, Spin } from 'antd'
|
||||||
import { AntIcon, ComponentDynamic, Container } from 'components'
|
import { AntIcon, ComponentDynamic, Container } from 'components'
|
||||||
import { isEqual } from 'lodash'
|
import { isEqual, merge } from 'lodash'
|
||||||
|
|
||||||
const parts = [
|
const parts = [
|
||||||
{
|
{
|
||||||
@@ -61,10 +61,7 @@ export default class index extends Component {
|
|||||||
for (const child of this.children) {
|
for (const child of this.children) {
|
||||||
try {
|
try {
|
||||||
const data = await child.getData()
|
const data = await child.getData()
|
||||||
this.formData = {
|
merge(this.formData, data)
|
||||||
...this.formData,
|
|
||||||
...data,
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user