From 0686a9ae86c9fc3f404ea49d2defb5c1c1f2c0e0 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Thu, 18 Jun 2026 14:02:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20TextBase=E7=A9=BA=E5=80=BCundefined?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E4=B8=BA=E7=A9=BA=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - set_attrs: innerHTML兜底空字符串 - set_otext: otxt空值兜底 - set_text: text空值兜底 --- bricks/widget.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bricks/widget.js b/bricks/widget.js index f5d5d9b..9e9ae98 100644 --- a/bricks/widget.js +++ b/bricks/widget.js @@ -441,11 +441,11 @@ bricks.TextBase = class extends bricks.JsWidget { if (this.i18n && this.otext) { this.text = bricks.app.i18n._(this.otext); } - this.dom_element.innerHTML = this.text; + this.dom_element.innerHTML = this.text || ''; } set_otext(otxt){ var text; - this.otext = otxt; + this.otext = otxt || ''; if (this.i18n) { text = bricks.app.i18n._(this.otext); } else { @@ -464,7 +464,7 @@ bricks.TextBase = class extends bricks.JsWidget { } set_text(text){ this.text = text; - this.dom_element.innerHTML = this.text; + this.dom_element.innerHTML = this.text || ''; } }