fix: TextBase空值undefined渲染为空字符串
- set_attrs: innerHTML兜底空字符串 - set_otext: otxt空值兜底 - set_text: text空值兜底
This commit is contained in:
parent
306f5cb1b9
commit
0686a9ae86
@ -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 || '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user