|
@@ -29,19 +29,19 @@ function createNotification() {
|
|
|
}
|
|
|
|
|
|
let notification
|
|
|
-const notice = (type, content, duration=2000, onClose) => {
|
|
|
+const notice = (type, content, duration=2000, onClose, showClose=true) => {
|
|
|
if (!notification) notification = createNotification()
|
|
|
- return notification.addNotice({ type, content, duration, onClose })
|
|
|
+ return notification.addNotice({ type, content, duration, onClose,showClose })
|
|
|
}
|
|
|
|
|
|
export default {
|
|
|
- info(content, duration, onClose) {
|
|
|
- return notice('info', content, duration, onClose)
|
|
|
+ info(content, duration, onClose, showClose) {
|
|
|
+ return notice('info', content, duration, onClose, showClose)
|
|
|
},
|
|
|
- success(content = '操作成功', duration, onClose) {
|
|
|
- return notice('success', content, duration, onClose)
|
|
|
+ success(content = '操作成功', duration, onClose, showClose) {
|
|
|
+ return notice('success', content, duration, onClose, showClose)
|
|
|
},
|
|
|
- error(content, duration , onClose) {
|
|
|
- return notice('error', content, duration, onClose)
|
|
|
+ error(content, duration , onClose, showClose) {
|
|
|
+ return notice('error', content, duration, onClose, showClose)
|
|
|
}
|
|
|
}
|