zoukankan      html  css  js  c++  java
  • 刷新组件

    // 根组件/父路由
    <template>
     <div class="layout">
      <el-container>
       <el-header>
         头部代码
       </el-header>
       <el-main>
        <router-view v-if="isRouterAlive" />
       </el-main>
      </el-container>
     </div>
    </template>
    
    <script>
    export default {
     name: 'Layout',
     provide: function() {
      return {
       reload: this.reload,
      }
     },
     data() {
      return {
       isRouterAlive: true,
      }
     },
     methods: {
      reload() {
       this.isRouterAlive = false
       this.$nextTick(() => {
        this.isRouterAlive = true
       })
      },
     },
    }
    </script>
    
    <style scoped>
    
    </style>
        
    // 子路由
    export default {
     name: 'UserManagement',
     inject: ['reload'],
     data(){return{}}
    }
  • 相关阅读:
    Logstash
    收藏学习Linux好用的网站
    Elasticsearch
    Elasticsearch-head
    Kibana
    Metricbeat
    filebeat
    elelelleeleELK
    MySQL对库的操作
    【Django】URL控制器
  • 原文地址:https://www.cnblogs.com/lyt520/p/14865780.html
Copyright © 2011-2022 走看看