Fix persistent search in items
This commit is contained in:
@ -24,7 +24,7 @@
|
|||||||
color="secondary"
|
color="secondary"
|
||||||
v-model="search"
|
v-model="search"
|
||||||
class="col-6"
|
class="col-6"
|
||||||
@input="updateSearchUrl"
|
@update:model-value="updateSearchUrl"
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
@ -138,12 +138,13 @@ export default {
|
|||||||
return colors[state]
|
return colors[state]
|
||||||
},
|
},
|
||||||
updateSearchUrl: debounce(function () {
|
updateSearchUrl: debounce(function () {
|
||||||
this.$router.replace({ path: this.$router.path, query: { search: this.search } })
|
this.$router.replace({ path: this.$router.path, query: { ...this.$route.query, search: this.search } })
|
||||||
}, 300),
|
}, 300),
|
||||||
updatePaginationUrl: debounce(function () {
|
updatePaginationUrl: debounce(function () {
|
||||||
this.$router.replace({
|
this.$router.replace({
|
||||||
path: this.$router.path,
|
path: this.$router.path,
|
||||||
query: {
|
query: {
|
||||||
|
...this.$route.query,
|
||||||
...this.pagination
|
...this.pagination
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user