This commit is contained in:
yumoqing 2024-02-21 14:20:28 +08:00
parent 1f19465f65
commit f92a8a3f23

View File

@ -504,6 +504,7 @@ bricks.UiText =class extends bricks.UiType {
this.value = this.dom_element.innerText;
}
resultValue(){
this.value = this.dom_element.innerText;
return this.value;
}
setValue(v){
@ -572,12 +573,17 @@ bricks.UiCode =class extends bricks.UiType {
e.replaceChildren();
var v = this.opts.value || this.opts.defaultvalue;
this.value = v;
e.value = v;
this.option_widgets = {};
for (var i=0; i<data.length; i++){
var o = document.createElement('option');
o.value = data[i][this.opts.valueField||'value'];
o.innerText = bricks.app.i18n._(data[i][this.opts.textField||'text']);
this.option_widgets[o.value] = o;
if (!v && i == 0){
v = o.value;
e.value = o.value;
}
if (o.value == v){
o.selected = true;
}