1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <template>
- <div id="app">
- <!-- <img src="./assets/logo.png"> -->
- <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(){
- console.log("111111")
- },
- };
- </script>
-
- <style></style>
|