App.vue 717 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <div id="app">
  3. <router-view v-if="isRouterAlive" />
  4. <el-backtop :bottom="80" :right="60" :visibility-height="1100">
  5. <div ><i class="el-icon-caret-top" style="color:#ee7000;"></i></div>
  6. </el-backtop>
  7. </div>
  8. </template>
  9. <script>
  10. export default {
  11. name: "App",
  12. provide() {
  13. return {
  14. reload: this.reload,
  15. };
  16. },
  17. data() {
  18. return {
  19. isRouterAlive: true,
  20. };
  21. },
  22. methods: {
  23. reload() {
  24. this.isRouterAlive = false;
  25. this.$nextTick(function () {
  26. this.isRouterAlive = true;
  27. });
  28. },
  29. },
  30. };
  31. </script>
  32. <style>
  33. .icon {
  34. width: 34px;
  35. height: 34px;
  36. vertical-align: -0.15em;
  37. fill: currentColor;
  38. overflow: hidden;
  39. }
  40. </style>