App.vue 567B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <div id="app" class="app">
  3. <router-view v-if="isRouterAlive"></router-view>
  4. </div>
  5. </template>
  6. <script>
  7. export default{
  8. name: 'App',
  9. provide () {
  10. return {
  11. reload:this.reload
  12. }
  13. },
  14. data(){
  15. return{
  16. isRouterAlive:true
  17. }
  18. },
  19. methods: {
  20. reload(){
  21. this.isRouterAlive = false;
  22. this.$nextTick(function(){
  23. this.isRouterAlive = true;
  24. })
  25. }
  26. }
  27. }
  28. </script>
  29. <style lang="scss" scoped>
  30. .app{
  31. -webkit-overflow-scrolling: touch;
  32. }
  33. </style>