diff --git a/components/search/Search.vue b/components/search/Search.vue index 57f7172d53..e90d0f07cc 100644 --- a/components/search/Search.vue +++ b/components/search/Search.vue @@ -126,6 +126,11 @@ export default class Search extends mixins( this.initKeyboardEventHandler({ f: this.bindFilterEvents, }) + if (!this.name && this.$route.query.search) { + this.name = Array.isArray(this.$route.query.search) + ? '' + : this.$route.query.search + } } public mounted(): void { @@ -238,7 +243,7 @@ export default class Search extends mixins( @Emit('update:search') @Debounce(50) updateSearch(value: string): string { - if (value !== this.searchQuery) { + if (!value != !this.$route.query.search && value !== this.searchQuery) { this.replaceUrl({ search: value ?? undefined }, this.$route.path) } return value @@ -284,7 +289,7 @@ export default class Search extends mixins( ...queryCondition, }, }) - .catch(this.$consola.warn /*Navigation Duplicate err fix later */) + .catch(this.$consola.warn) // if searchbar request or filter is set, pagination should always revert to page 1 this.$emit('resetPage') }