App.vue 687 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div id="app">
  3. <router-view v-if="isRouterAlive"/>
  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. mounted(){
  20. },
  21. methods:{
  22. reload () {
  23. this.isRouterAlive = false
  24. this.$nextTick(function () {
  25. this.isRouterAlive = true
  26. })
  27. }
  28. }
  29. }
  30. </script>
  31. <style>
  32. #app {
  33. width: 100%;
  34. height: 100%;
  35. font-family: "微软雅黑","Microsoft YaHei",Arial;
  36. background: #f7f7f7;
  37. }
  38. .ztree li span.button.add{margin-right:2px;background-position:-144px 0;vertical-align:top;*vertical-align:middle}
  39. </style>