fix: 修复搜索历史为空时的展示问题
- 在搜索历史 API 调用失败时,确保返回非空数组 - 避免在搜索建议列表为空时出现错误或异常
This commit is contained in:
parent
d46b630841
commit
227d952112
@ -4683,6 +4683,7 @@ export default {
|
|||||||
cb(this.searchSuggestions)
|
cb(this.searchSuggestions)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.error("Error fetching search history:", error)
|
console.error("Error fetching search history:", error)
|
||||||
|
cb(this.searchSuggestions.length > 0 ? this.searchSuggestions : [])
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleSelectSuggestion(item) {
|
handleSelectSuggestion(item) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user