|
|
|
@ -23,21 +23,30 @@ 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;
|
|
|
|
|
}
|
|
|
|
|
notification.open(data);
|
|
|
|
|
// 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,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|