| | |
| | | MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle) |
| | | } |
| | | |
| | | updateComponentStyle = (item) => { |
| | | updateComponentStyle = (parentId, keys, style) => { |
| | | const { config } = this.state |
| | | |
| | | if (config.uuid !== item.uuid) return |
| | | if (config.uuid !== parentId) return |
| | | |
| | | let components = config.components.map(item => { |
| | | if (keys.includes(item.uuid)) { |
| | | item.style = {...item.style, ...style} |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | this.setState({ |
| | | config: {...config, components: []} |
| | | }, () => { |
| | | this.setState({ |
| | | config: {...config, components: item.components} |
| | | config: {...config, components: components} |
| | | }) |
| | | }) |
| | | } |