iter(g161): 通知支持同 key 原地更新
This commit is contained in:
@@ -2290,6 +2290,11 @@
|
||||
"t": "'top-right' | 'bottom-right' | 'top-left' | 'bottom-left'",
|
||||
"df": "bottom-right",
|
||||
"d": "停靠角落;每个角落独立堆叠(同角最多 3 条),右上与 toast 同侧,建议次要信息放左侧"
|
||||
},
|
||||
{
|
||||
"n": "key",
|
||||
"t": "string",
|
||||
"d": "同 key 复用同一张卡:再次调用只原地改标题 / 描述 / 语义色,不再堆新条(返回的句柄带 update 方法可主动改)"
|
||||
}
|
||||
],
|
||||
"example": "const { close } = notification({ title: '导出完成', description: 'report.csv 已开始下载', variant: 'success', duration: 4000 }); // close() 手动关闭",
|
||||
@@ -2299,7 +2304,8 @@
|
||||
"返回 { el, close } 句柄:程序化关闭用 close(),需要自己挂交互就用 el",
|
||||
"action 放操作区(常见为按钮);variant 决定左侧条与圆点语义色",
|
||||
"与 toast 的分工:toast 右上角轻量瞬时,notification 右下角可长读、可操作",
|
||||
"停靠角落用 placement 调:四个角各自独立堆叠与节流,顶部角落新通知从屏幕边缘长出、旧的往下让"
|
||||
"停靠角落用 placement 调:四个角各自独立堆叠与节流,顶部角落新通知从屏幕边缘长出、旧的往下让",
|
||||
"进度类通知传 key: 'sync-job':第一次返回句柄,后续 job.update({ title, description, variant }) 就地把同一条卡改成 60% / 完成,不会像以前那样堆出三条;job.close() 收掉时同时释放 key 登记"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user