mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: autocomplete: fix value() method
This commit is contained in:
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() {
|
||||
|
||||
Reference in new issue
Block a user