fix: notify组件不同类型关闭时间对齐华为云规范 (#20)
This commit is contained in:
parent
231179ae81
commit
c98486ba74
|
@ -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])
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ export default {
|
|||
customClass: [String, Object],
|
||||
duration: {
|
||||
type: Number,
|
||||
default: 4500
|
||||
default: 0
|
||||
},
|
||||
message: [String, Function],
|
||||
onClose: Function,
|
||||
|
|
Loading…
Reference in New Issue