From 77bf53215f9834032b508a416cfe2d4695509c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 6 Jul 2019 10:33:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/common/SnackbarHOC.js | 39 ++++++++++++++++---------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/public/react/src/common/SnackbarHOC.js b/public/react/src/common/SnackbarHOC.js index a59607bf4..d66b697ca 100644 --- a/public/react/src/common/SnackbarHOC.js +++ b/public/react/src/common/SnackbarHOC.js @@ -23,22 +23,31 @@ export function SnackbarHOC(options = {}) { } // 全局的snackbar this.props.showSnackbar调用即可 - showSnackbar(description, message = "提示",icon) { - // this.setState({ - // snackbarOpen: true, - // snackbarText: text, - // snackbarVertical: vertical, - // snackbarHorizontal: horizontal, - // }) - const data = { - message, - description - } - if (icon) { - data.icon = icon; + // showSnackbar(description, message = "提示",icon) { + // // this.setState({ + // // snackbarOpen: true, + // // snackbarText: text, + // // snackbarVertical: vertical, + // // snackbarHorizontal: horizontal, + // // }) + // const data = { + // message, + // description + // } + // if (icon) { + // data.icon = icon; + // } + // notification.open(data); + // } + + showSnackbar(text, vertical, horizontal) { + this.setState({ + snackbarOpen: true, + snackbarText: text, + snackbarVertical: vertical, + snackbarHorizontal: horizontal, + }) } - notification.open(data); - } render() { const { snackbarOpen, snackbarText, snackbarHorizontal, snackbarVertical } = this.state;