Skip to content

Commit

Permalink
fix(core): 修复下拉选择框只有value值时不显示的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Dec 5, 2023
1 parent 5baac27 commit 2d5f371
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/elements/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class ConfigElement<T extends keyof ConfigTagMap = 'input'> extends IElem
const option = el('option');
if (Array.isArray(item)) {
option.value = item[0];
option.textContent = item[1];
option.textContent = item[1] ?? item[0];
if (item[2]) {
option.title = item[2];
}
Expand All @@ -53,7 +53,7 @@ export class ConfigElement<T extends keyof ConfigTagMap = 'input'> extends IElem
this.provider.add(option);
} else {
option.value = item.value;
option.textContent = item.label;
option.textContent = item.label ?? item.value;
if (item.title) {
option.title = item.title;
}
Expand Down

0 comments on commit 2d5f371

Please sign in to comment.