Fixed scroll to top.
This commit is contained in:
@@ -20,8 +20,11 @@
|
||||
@show-filters="(state) => toggleFilters(state)"
|
||||
/>
|
||||
|
||||
<div class="content">
|
||||
<router-view />
|
||||
<div
|
||||
ref="content"
|
||||
class="content"
|
||||
>
|
||||
<router-view @scroll="scrollToTop" />
|
||||
</div>
|
||||
|
||||
<Filters
|
||||
@@ -68,6 +71,10 @@ function resize(event) {
|
||||
this.events.emit('resize', event);
|
||||
}
|
||||
|
||||
function scrollToTop() {
|
||||
this.$refs.content.scrollTop = 0;
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
document.addEventListener('click', this.blur);
|
||||
window.addEventListener('resize', this.resize);
|
||||
@@ -100,6 +107,7 @@ export default {
|
||||
setConsent,
|
||||
blur,
|
||||
resize,
|
||||
scrollToTop,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user