From 0a0372f158b7a4c786c67be6a6e3c84ff7608904 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 07 一月 2021 10:35:10 +0800
Subject: [PATCH] 2021-01-07

---
 src/views/menudesign/index.jsx |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index fb9e3ae..2c188a0 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -93,6 +93,7 @@
     MKEmitter.addListener('delButtons', this.delButtons)
     MKEmitter.addListener('copyButtons', this.copyButtons)
     MKEmitter.addListener('changePopview', this.initPopview)
+    MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle)
   }
 
   /**
@@ -105,6 +106,21 @@
     MKEmitter.removeListener('delButtons', this.delButtons)
     MKEmitter.removeListener('copyButtons', this.copyButtons)
     MKEmitter.removeListener('changePopview', this.initPopview)
+    MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle)
+  }
+
+  updateComponentStyle = (item) => {
+    const { config } = this.state
+
+    if (config.uuid !== item.uuid) return
+
+    this.setState({
+      config: {...config, components: []}
+    }, () => {
+      this.setState({
+        config: {...config, components: item.components}
+      })
+    })
   }
 
   delButtons = (items) => {

--
Gitblit v1.8.0