feat: Notification API + 自定义渲染函数 + stack独立配置完善

This commit is contained in:
tianhao
2026-06-16 13:02:23 +08:00
parent 88ae899d96
commit 23745952e5
2 changed files with 19 additions and 0 deletions
+7
View File
@@ -246,6 +246,13 @@ class Toast {
}
_buildContent(el, c) {
// 自定义渲染函数 — 完全接管 DOM 构建
if (typeof this.config.render === 'function') {
el.innerHTML = this.config.render(this);
this.barEl = el.querySelector('.met-bar, .met-bar-v');
return;
}
const showIcon = this.config.icon !== false && (this.iconHTML || ICONS[this.type]);
const showClose = this.config.closeButton !== false;
const showProgress = this.config.showProgress !== false && this.config.duration > 0;