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.movies = movies;
|
||||||
this.totalCount = totalCount;
|
this.totalCount = totalCount;
|
||||||
|
|
||||||
|
this.$refs.tiles.scrollIntoView();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function mounted() {
|
async function mounted() {
|
||||||
|
@ -76,7 +78,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
movies: [],
|
movies: [],
|
||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
limit: 30,
|
limit: 5,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
@ -20,7 +20,10 @@
|
||||||
<script>
|
<script>
|
||||||
function search(typing) {
|
function search(typing) {
|
||||||
if (!typing || this.eager) {
|
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