App.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <div id="app">
  3. <v-tour name="myTour" :steps="steps" :options="myOptions" :callbacks="myCallbacks" v-if="tourFlg"></v-tour>
  4. <transition name="fade" mode="out-in">
  5. <!-- <keep-alive>
  6. <router-view v-if='$route.meta != null && $route.meta.keepAlive'/>
  7. </keep-alive> -->
  8. <router-view v-if="isRouterAlive"/>
  9. </transition>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'app',
  15. components: {},
  16. //父组件中返回要传给下级的数据
  17. provide() {
  18. return {
  19. reloads: this.reloads,
  20. }
  21. },
  22. data(){
  23. return{
  24. isRouterAlive:true,
  25. firstTourFalse: false
  26. }
  27. },
  28. mounted() {
  29. this.firstTourFalse = localStorage.getItem('firstTourFalse') | true
  30. // 监听页面刷新事件
  31. window.addEventListener('unload', this.setItemFirstTourFalse)
  32. },
  33. methods:{
  34. setItemFirstTourFalse() {
  35. localStorage.setItem('firstTourFalse', firstTourFalse)
  36. },
  37. reloads(){
  38. this.isRouterAlive = false
  39. this.$nextTick(() => {
  40. this.isRouterAlive = true
  41. })
  42. }
  43. }
  44. }
  45. </script>
  46. <style>
  47. .v-tour__target--highlighted {
  48. box-shadow: 0 0 0 99999px rgba(0,0,0,.4) !important;
  49. }
  50. </style>
  51. <style lang="scss">
  52. body {
  53. margin: 0px;
  54. padding: 0px;
  55. font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
  56. font-size: 14px;
  57. -webkit-font-smoothing: antialiased;
  58. }
  59. #app {
  60. position: absolute;
  61. top: 0px;
  62. bottom: 0px;
  63. width: 100%;
  64. }
  65. .el-submenu [class^=fa] {
  66. vertical-align: baseline;
  67. margin-right: 10px;
  68. }
  69. .el-menu-item [class^=fa] {
  70. vertical-align: baseline;
  71. margin-right: 10px;
  72. }
  73. .toolbar {
  74. background: #f2f2f2;
  75. padding: 10px;
  76. .el-form-item {
  77. margin-bottom: 10px;
  78. }
  79. }
  80. .fade-enter-active,
  81. .fade-leave-active {
  82. transition: all .2s ease;
  83. }
  84. .fade-enter,
  85. .fade-leave-active {
  86. opacity: 0;
  87. }
  88. .resetElEmtClass {
  89. .el-dialog__body {
  90. padding: 0 !important;
  91. }
  92. }
  93. </style>