App.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <div id="app">
  3. <router-view v-if="isRouterAlive"></router-view>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. name: 'app',
  9. components: {},
  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. }
  29. </script>
  30. <style lang="scss">
  31. body {
  32. margin: 0px;
  33. padding: 0px;
  34. font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
  35. font-size: 14px;
  36. -webkit-font-smoothing: antialiased;
  37. background: #fff;
  38. }
  39. #app {
  40. position: absolute;
  41. top: 0px;
  42. bottom: 0px;
  43. width: 100%;
  44. background: #fff;
  45. }
  46. </style>