king
2020-07-06 e0e5aa28cbd509579c7a83672a93241c9a5ed7e9
src/views/mobdesign/index.jsx
@@ -125,6 +125,22 @@
    })
  }
  updateStyle = (proper) => {
    const { config } = this.state
    config.components = config.components.map(component => {
      if (component.uuid === proper.componentId) {
        Object.keys(component).forEach(key => {
          if (component[key].editable && component[key].uuid === proper.uuid) {
            component[key].style = {...component[key].style, ...proper.style}
          }
        })
      }
      return component
    })
    this.setState({config})
  }
  updateConfig = (config) => {
    this.setState({
      config: config
@@ -162,10 +178,10 @@
              </div> : null
            }
            <div className="mob-setting">
              {config ? <Tabs defaultActiveKey="2" animated={false} size="small">
              {config ? <Tabs defaultActiveKey="1" animated={false} size="small">
                <TabPane tab="配置" key="1">
                  {/* <SketchPicker /> */}
                  <Controller editElem={editElem} />
                  <Controller editElem={editElem} updateStyle={this.updateStyle} />
                </TabPane>
                <TabPane tab="数据源" key="2">
                  <DataSource config={config} updateConfig={this.updateConfig} />