From 0da0262bc236cfce928429fc4c48e1666eab3402 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 07 一月 2021 17:12:04 +0800 Subject: [PATCH] 2021-01-07 --- src/views/menudesign/index.jsx | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 2c188a0..7ba908b 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -109,16 +109,23 @@ 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} }) }) } -- Gitblit v1.8.0