58 lines
		
	
	
		
			952 B
		
	
	
	
		
			Python
		
	
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			952 B
		
	
	
	
		
			Python
		
	
	
	
| <template>
 | |
|   <div id="app">
 | |
|     <router-view v-if='isRouterAlive'/>
 | |
|   </div>
 | |
| </template>
 | |
| 
 | |
| <script>
 | |
| export default {
 | |
|   name: 'App',
 | |
|   provide(){
 | |
|     return{
 | |
|       reload:this.reload
 | |
|     }
 | |
|   },
 | |
|   data(){
 | |
|     return{
 | |
|       isRouterAlive:true,
 | |
|       timer:null
 | |
|     }
 | |
|   },
 | |
|   mounted(){
 | |
|     this.$store.dispatch("user/getCount", {});
 | |
|     this.timer = window.setInterval(() => {
 | |
|       setTimeout(() => {
 | |
|         this.$store.dispatch("user/getCount", {})
 | |
|       },0)
 | |
|     },30000)
 | |
| 
 | |
|   },
 | |
|   methods:{
 | |
|     reload(){
 | |
|       this.isRouterAlive=false;
 | |
|       this.$nextTick(function () {
 | |
|         this.isRouterAlive=true;
 | |
|       })
 | |
|     },
 | |
|   },
 | |
|   destroyed() {
 | |
|     clearInterval(this.timer)
 | |
|   }
 | |
| }
 | |
| </script>
 | |
| <style>
 | |
|   .el-step__head.is-process>.is-text{
 | |
|     color: #ffffff;
 | |
|     background: #409EFF;
 | |
|     border-color: #409EFF;
 | |
|   }
 | |
|   .el-step__title.is-process{
 | |
|     color: #409EFF;
 | |
|   }
 | |
|   .navbarBadge .el-badge__content.is-fixed{
 | |
|     top: 15px;
 | |
|     right: 18px;
 | |
|   }
 | |
| 
 | |
| </style>
 |