diff --git a/packages/notify/index.js b/packages/notify/index.js index bc75899dd3..ec146d9835 100644 --- a/packages/notify/index.js +++ b/packages/notify/index.js @@ -25,6 +25,13 @@ const IconMap = { success: iconSuccessful() } +const durationMap = { + info: 5000, + success: 5000, + warning: 10000, + error: 10000 +} + const positionList = ['top-right', 'bottom-right'] const debounce = (fn, debounceDelay) => { @@ -55,6 +62,7 @@ const notify = (options) => { options.type = 'info' } + options.duration = options.duration ? options.duration : durationMap[options.type] options.position = !~positionList.indexOf(options.position) ? 'bottom-right' : options.position !options.statusIcon && options.type && (options.statusIcon = IconMap[options.type]) diff --git a/packages/notify/src/index.vue b/packages/notify/src/index.vue index a6aebcbc97..650014d122 100644 --- a/packages/notify/src/index.vue +++ b/packages/notify/src/index.vue @@ -25,7 +25,7 @@ export default { customClass: [String, Object], duration: { type: Number, - default: 4500 + default: 0 }, message: [String, Function], onClose: Function,