Reset pagination on search, scroll into view when paginating search.
This commit is contained in:
parent
0cbb985945
commit
f0a6e80e5a
|
@ -58,6 +58,8 @@ async function searchMovies() {
|
|||
|
||||
this.movies = movies;
|
||||
this.totalCount = totalCount;
|
||||
|
||||
this.$refs.tiles.scrollIntoView();
|
||||
}
|
||||
|
||||
async function mounted() {
|
||||
|
@ -76,7 +78,7 @@ export default {
|
|||
return {
|
||||
movies: [],
|
||||
totalCount: 0,
|
||||
limit: 30,
|
||||
limit: 5,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -20,7 +20,10 @@
|
|||
<script>
|
||||
function search(typing) {
|
||||
if (!typing || this.eager) {
|
||||
this.$router.replace({ query: { query: this.query || undefined } });
|
||||
this.$router.replace({
|
||||
query: { query: this.query || undefined },
|
||||
params: { ...this.$route.params, pageNumber: 1 },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue