From 455bdae0e5e1d9f66a552f74707f825c8b49ee5a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 15 一月 2021 00:35:22 +0800 Subject: [PATCH] 2021-01-15 --- src/menu/components/share/usercomponent/index.jsx | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/menu/components/share/usercomponent/index.jsx b/src/menu/components/share/usercomponent/index.jsx index ab376c6..8936f77 100644 --- a/src/menu/components/share/usercomponent/index.jsx +++ b/src/menu/components/share/usercomponent/index.jsx @@ -21,7 +21,8 @@ state = { dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, visible: false, - loading: false + loading: false, + name: '' } shouldComponentUpdate (nextProps, nextState) { @@ -29,9 +30,12 @@ } trigger = () => { + const { config } = this.props + this.setState({ visible: true, - loading: false + loading: false, + name: window.GLOB.UserComponentMap.get(config.uuid) || config.name || '' }) } @@ -91,7 +95,7 @@ } render () { - const { visible, dict, loading } = this.state + const { visible, dict, loading, name } = this.state return ( <div className="user-component-wrap"> @@ -107,7 +111,7 @@ onCancel={this.cancel} destroyOnClose > - <UserForm dict={dict} inputSubmit={this.submit} wrappedComponentRef={(inst) => this.verifyRef = inst}/> + <UserForm dict={dict} name={name} inputSubmit={this.submit} wrappedComponentRef={(inst) => this.verifyRef = inst}/> </Modal> </div> ) -- Gitblit v1.8.0