This commit is contained in:
670788339
2025-11-02 17:20:31 +08:00
parent 743478655e
commit a656c27e24
2 changed files with 183 additions and 197 deletions

View File

@@ -261,24 +261,10 @@ export default {
console.log("----------newTag---------->",this.searchResults)
this.tagMap.set(newTag.id, newTag)
this.$emit('change', this.displayTags)
this.clearInput();
} finally {
this.loading = false
}
},
clearInput() {
if (this.$refs.tagSelect) {
const input = this.$refs.tagSelect.$refs.input;
if (input) {
input.value = '';
// 触发输入事件以确保组件状态同步
input.dispatchEvent(new Event('input'));
}
}
},
// 修改doSearch方法添加搜索结果为空时的提示
async doSearch(query) {
// 不再在空查询时清空搜索结果