血透系统pad前端

App.vue 622B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <div id="app">
  3. <!-- <img src="./assets/logo.png"> -->
  4. <router-view v-if="isRouterAlive" />
  5. </div>
  6. </template>
  7. <script>
  8. export default {
  9. name: 'App',
  10. provide () {
  11. return {
  12. reload: this.reload
  13. }
  14. },
  15. data () {
  16. return {
  17. isRouterAlive: true
  18. }
  19. },
  20. methods: {
  21. reload () {
  22. this.isRouterAlive = false
  23. this.$nextTick(function () {
  24. this.isRouterAlive = true
  25. })
  26. }
  27. },
  28. watch: {
  29. '$route': function (to, from) {
  30. document.body.scrollTop = 0
  31. document.documentElement.scrollTop = 0
  32. }
  33. }
  34. }
  35. </script>
  36. <style>
  37. </style>