Enter listener on Search
This commit is contained in:
@@ -41,14 +41,19 @@ export default {
|
||||
watch: {
|
||||
$route(updatedChanges) {
|
||||
clearTimeout(this.debounceID)
|
||||
this.debounceID = setTimeout(() => {
|
||||
const updateSearch = () => {
|
||||
const keywords = updatedChanges.query.keywords
|
||||
const tags = updatedChanges.query.tags
|
||||
this.searchInput = {
|
||||
keywords: keywords && R.split(',', keywords),
|
||||
tags: tags && R.split(',', tags),
|
||||
}
|
||||
}, 300)
|
||||
}
|
||||
|
||||
if (updatedChanges.query.enter !== 'true')
|
||||
this.debounceID = setTimeout(updateSearch, 300)
|
||||
else
|
||||
updateSearch()
|
||||
},
|
||||
searchInput(searchInput) {
|
||||
this.resources = this.$store.getters['data/findBySearchInputs'](searchInput.keywords, searchInput.tags)
|
||||
|
||||
Reference in New Issue
Block a user