This commit is contained in:
yumoqing 2025-10-26 14:29:39 +08:00
parent 5f05212770
commit 94dffa5552

View File

@ -336,18 +336,22 @@ bricks.TextBase = class extends bricks.JsWidget {
rate: rate:
halign: halign:
valign: valign:
color:
bgtcolor:
css css
} }
*/ */
constructor(options){ constructor(options){
options.halign = options.halign || 'center';
options.valign = options.valign || 'center';
super(options); super(options);
this.opts = options; this.opts = options;
this.rate = this.opts.rate || 1; this.rate = this.opts.rate || 1;
this.specified_fontsize = false; this.specified_fontsize = false;
this.set_attrs(); this.set_attrs();
this.dom_element.style.fontWeight = 'normal'; this.dom_element.style.fontWeight = 'normal';
this.set_style('display', 'flex');
this.set_style('justifyContent', options.halign);
this.set_style('alignItems', options.valign);
this.set_style('flexWrap', options.wrap);
if (self.i18n){ if (self.i18n){
bricks.app.bind('lang', this.set_i18n_text.bind(this)); bricks.app.bind('lang', this.set_i18n_text.bind(this));
} }