App.vue 732 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <router-view v-if="routerState"/>
  3. </template>
  4. <script>
  5. export default {
  6. data(){
  7. return{
  8. routerState: true
  9. }
  10. },
  11. provide() {
  12. return {
  13. reload: this.reload
  14. }
  15. },
  16. methods: {
  17. reload() { //重载组件
  18. this.routerState = false;
  19. this.$nextTick(() => {
  20. this.routerState = true;
  21. })
  22. }
  23. }
  24. }
  25. </script>
  26. <style lang="less">
  27. *{
  28. list-style: none;
  29. margin: 0;
  30. padding: 0;
  31. }
  32. body,HTML{
  33. width: 100%;
  34. height: 100%;
  35. }
  36. .flexc{display: flex;align-items: center;}
  37. .flexcc{display: flex;align-items: center;justify-content: center;}
  38. .flex0{flex: 0 0 auto;}
  39. .flex1{flex:1;}
  40. </style>