fix: 激活gap/offset死配置; 优化style空对象遍历
This commit is contained in:
+3
-3
@@ -184,9 +184,9 @@ class Toast {
|
|||||||
el.style.cssText = `
|
el.style.cssText = `
|
||||||
display:flex;
|
display:flex;
|
||||||
flex-direction:column;
|
flex-direction:column;
|
||||||
gap:12px;
|
gap:${this.config.gap || 12}px;
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
padding:24px;
|
padding:${this.config.offset || 24}px;
|
||||||
max-width:100vw;
|
max-width:100vw;
|
||||||
position:fixed;
|
position:fixed;
|
||||||
z-index:${zIndex};
|
z-index:${zIndex};
|
||||||
@@ -241,7 +241,7 @@ class Toast {
|
|||||||
set('max-width', 'calc(100vw - 48px)');
|
set('max-width', 'calc(100vw - 48px)');
|
||||||
set('width', widthValue);
|
set('width', widthValue);
|
||||||
// 用户自定义样式最后应用
|
// 用户自定义样式最后应用
|
||||||
if (this.config.style) {
|
if (this.config.style && Object.keys(this.config.style).length > 0) {
|
||||||
Object.entries(this.config.style).forEach(([k, v]) => { el.style[k] = v; });
|
Object.entries(this.config.style).forEach(([k, v]) => { el.style[k] = v; });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user