ui: autocomplete: fix value() method

This commit is contained in:
无限UCW committed 2021-08-25 18:06:20 +08:00
1 parent 329d047699
commit 73e9c49a8f
2 files changed
+5 -8

No files matched your search

@@ -71,12 +71,8 @@ export default class AutoComplete extends DOMAttachedObject {
}
value() {
if (this.ref?.getSelectedItems) {
const selected = this.ref.getSelectedItems();
if (this.options.multi) return selected;
return selected[0];
}
return this.$dom.val();
if (this.options.multi) return this.$dom.val();
return this.ref?.getSelectedItems()[0] ?? null;
}
detach() {