|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div id="app">
|
|
|
+ <div ref="app" id="app">
|
|
|
<heads></heads>
|
|
|
<router-view :key="$route.fullPath" />
|
|
|
<foot></foot>
|
|
@@ -22,7 +22,13 @@ export default {
|
|
|
return {};
|
|
|
},
|
|
|
mounted() {},
|
|
|
- methods: {}
|
|
|
+ methods: {},
|
|
|
+ // 路由改变重置当前选项
|
|
|
+ watch: {
|
|
|
+ $route(to, from) {
|
|
|
+ this.$refs.app.scrollTop = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -30,5 +36,6 @@ export default {
|
|
|
#app {
|
|
|
width: 1920px;
|
|
|
height: 1080px;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
</style>
|