From 3f9dbff91e725326ace204e12fbc88e2dedd30fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E6=B6=9B?= Date: Wed, 13 Aug 2025 09:59:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=9D=A1=E5=B1=9E=E6=80=A7=E4=BF=AE=E6=94=B9bug=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 9bae171..5a49df9 100644 --- a/index.js +++ b/index.js @@ -1353,8 +1353,8 @@ class UI { } } else if (name == 'timeout') { this[name] = Number(newValue) - } else { - this[name] = newValue + } else if (name == 'type') { + this.Tip.className = this.Tip.part = `tip ${newValue}` } } // 初始化 @@ -1364,7 +1364,7 @@ class UI { const template = document.createElement('template') const style = document.createElement('style') this.Tip = document.createElement('div') - this.Tip.className = this.Tip.part = 'tip' + this.Tip.className = this.Tip.part = `tip ${type}` const contentSlot = document.createElement('slot') const prefixSlot = document.createElement('slot') contentSlot.name = 'content' @@ -1432,7 +1432,7 @@ class UI { height: 100%; fill: var(--close-color); } - .tip.info { + .tip { background: var(--background-color); color: var(--color); } @@ -1455,7 +1455,6 @@ class UI { this.hide() } - this.Tip.classList.add(type) this.Tip.style.display = hidden ? 'none' : 'flex' template.content.appendChild(prefixSlot) template.content.appendChild(contentSlot)