Skip to content

Commit c98486b

Browse files
authored
fix: notify组件不同类型关闭时间对齐华为云规范 (#20)
1 parent 231179a commit c98486b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/notify/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ const IconMap = {
2525
success: iconSuccessful()
2626
}
2727

28+
const durationMap = {
29+
info: 5000,
30+
success: 5000,
31+
warning: 10000,
32+
error: 10000
33+
}
34+
2835
const positionList = ['top-right', 'bottom-right']
2936

3037
const debounce = (fn, debounceDelay) => {
@@ -55,6 +62,7 @@ const notify = (options) => {
5562
options.type = 'info'
5663
}
5764

65+
options.duration = options.duration ? options.duration : durationMap[options.type]
5866
options.position = !~positionList.indexOf(options.position) ? 'bottom-right' : options.position
5967
!options.statusIcon && options.type && (options.statusIcon = IconMap[options.type])
6068

packages/notify/src/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default {
2525
customClass: [String, Object],
2626
duration: {
2727
type: Number,
28-
default: 4500
28+
default: 0
2929
},
3030
message: [String, Function],
3131
onClose: Function,

0 commit comments

Comments
 (0)