Browse Source

chore: 优化代码

es6
guy 2 years ago
parent
commit
4c7abdc0a4
  1. 2
      src/case/combo/textvaluecombo/combo.textvalue.js
  2. 3
      src/case/trigger/trigger.text.select.js

2
src/case/combo/textvaluecombo/combo.textvalue.js

@ -133,7 +133,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
mounted: function () {
const o = this.options;
if (BI.isKey(o.value)) {
if (BI.isKey(o.value) || BI.isObject(o.value)) {
this._checkError(o.value);
}
},

3
src/case/trigger/trigger.text.select.js

@ -67,10 +67,11 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
BI.each(formatItems, function (i, item) {
if (BI.contains(val, item.value) && !BI.contains(result, item.text || item.value)) {
result.push(item.text || item.value);
BI.remove(val, item.value);
}
});
if (result.length > 0) {
if (result.length > 0 && val.length === 0) {
return {
textCls: "",
text: result.join(","),

Loading…
Cancel
Save