Ashampoo? Photo Optimizer FREE
发布时间:2024-02-28 00:00:00 点击量:
{
console.log(err.name, err)
this.clearResults()
if (err.name !=='AbortError') {
this.isSearching=false
}
return
})
if (!json) return
this.results=json.results
this.totalProducts=json.totalProducts
this.isSearching=false
},
totalProducts: 0,
results: [],
clearResults () {
this.results=[]
this.totalProducts=0
},
init () {
this.$watch('searchTerm', value=> {
if (value) {
this.search()
}
})
this.$watch('showSearch', value=> {
if (!showSearch) {
this.clearResults()
this.searchTerm=''
}
})
}
}"
x-on:keydown.esc.document="clearResults(); $refs.input.focus()"
x-on:keydown.up.prevent="
if (!results.length) return
if (document.activeElement===$refs.input) return
if ($focus.focused()===$focus.within($refs.resultsList).getFirst()) {
$refs.input.focus()
return
}
$focus.prev()
"
x-on:keydown.down.prevent="
if (!results.length) return
if ($focus.focused()===$refs.input) {
$focus.within($refs.resultsList).getFirst().focus({ focusVisible: true })
return
}
$focus.next()
"
>