feat: Notification API + 自定义渲染函数 + stack独立配置完善
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user