fix: notify组件不同类型关闭时间对齐华为云规范 (#20)

This commit is contained in:
Alaray 2023-02-24 17:37:48 +08:00 committed by GitHub
parent 231179ae81
commit c98486ba74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -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])

View File

@ -25,7 +25,7 @@ export default {
customClass: [String, Object],
duration: {
type: Number,
default: 4500
default: 0
},
message: [String, Function],
onClose: Function,