12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <template>
- <div id="app">
- <!-- <img src="./assets/logo.png"> -->
- <!-- <div style="height: calc(100% + 1px)"><router-view v-if="isRouterAlive" /></div> -->
- <router-view v-if="isRouterAlive" />
- </div>
- </template>
-
- <script>
- export default {
- name: "App",
- provide() {
- return {
- reload: this.reload
- };
- },
- data() {
- return {
- isRouterAlive: true
- };
- },
- methods: {
- reload() {
- this.isRouterAlive = false;
- this.$nextTick(function() {
- this.isRouterAlive = true;
- });
- }
- },
- watch: {
- $route: function(to, from) {
- document.body.scrollTop = 0;
- document.documentElement.scrollTop = 0;
- }
- },
- created() {}
- };
- </script>
- <style lang="scss" scoped>
- #app {
- height: 100%;
- overflow-y: auto;
- border: 1px solid gainsboro;
- }
- </style>
|