mirror of
https://github.com/aelve/guide.git
synced 2024-12-23 12:52:31 +03:00
Fixed searching when user is already at search page
This commit is contained in:
parent
8c0bfbbefc
commit
82363d9705
@ -83,6 +83,7 @@ export default class SearchResults extends Vue {
|
||||
}
|
||||
|
||||
beforeMount () {
|
||||
// This watch should be added in beforeMount (only on client) hook because setDocumentTitle function uses DOM api which is undefined on server
|
||||
this.$watch('query', this.setDocumentTitle, { immediate: true })
|
||||
}
|
||||
|
||||
@ -91,6 +92,11 @@ export default class SearchResults extends Vue {
|
||||
}
|
||||
|
||||
async serverPrefetch () {
|
||||
await this.search()
|
||||
}
|
||||
|
||||
@Watch('query')
|
||||
async search () {
|
||||
await this.$store.dispatch('wiki/search', this.query)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user