App.vue 604 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div id="app">
  3. <router-view v-if="alive" />
  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. alive: true,
  17. };
  18. },
  19. methods: {
  20. reload() {
  21. this.alive = false;
  22. this.$nextTick(() => {
  23. this.alive = true;
  24. });
  25. },
  26. },
  27. };
  28. </script>
  29. <style lang="less">
  30. body {
  31. margin: 0;
  32. }
  33. .textOver {
  34. overflow: hidden;
  35. text-overflow: ellipsis;
  36. white-space: nowrap;
  37. }
  38. .w_1200 {
  39. width: 1200px;
  40. margin: 0 auto;
  41. }
  42. p {
  43. padding: 0;
  44. margin: 0;
  45. }
  46. </style>