From 7449eee8fa9f8a251e9c4e9162030f1e004bae0f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 15 十月 2020 09:17:04 +0800 Subject: [PATCH] 2020-10-15 --- src/menu/components/tabs/antv-tabs/index.jsx | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/src/menu/components/tabs/antv-tabs/index.jsx b/src/menu/components/tabs/antv-tabs/index.jsx index f1d986c..a32e8fb 100644 --- a/src/menu/components/tabs/antv-tabs/index.jsx +++ b/src/menu/components/tabs/antv-tabs/index.jsx @@ -71,6 +71,7 @@ componentDidMount () { MKEmitter.addListener('tabsChange', this.handleTabsChange) + MKEmitter.addListener('submitStyle', this.getStyle) } /** @@ -81,6 +82,27 @@ return } MKEmitter.removeListener('tabsChange', this.handleTabsChange) + MKEmitter.addListener('submitStyle', this.getStyle) + } + + changeStyle = () => { + const { tabs } = this.state + + MKEmitter.emit('changeStyle', [tabs.uuid], ['background', 'border', 'padding', 'margin'], tabs.style) + } + + getStyle = (comIds, style) => { + const { tabs } = this.state + + if (comIds.length !== 1 || comIds[0] !== tabs.uuid) return + + let _card = {...tabs, style} + + this.setState({ + tabs: _card + }) + + this.props.updateConfig(_card) } handleTabsChange = (parentId) => { @@ -230,6 +252,7 @@ <div className="mk-popover-control"> <Icon className="plus" title="娣诲姞鏍囩" type="plus" onClick={this.tabAdd} /> <SettingComponent config={tabs} updateConfig={this.updateComponent} /> + <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(tabs.uuid)} /> </div> } trigger="hover"> -- Gitblit v1.8.0