zoukankan      html  css  js  c++  java
  • vue+element 点击页面内跳转按钮 导航菜单选中

    <template> 
      <el-menu 
        router
        theme="dark"
        :default-active="activeIndex"
        class="el-menu-demo"
        active-text-color="rgb(250,83,83)"
        mode="horizontal"
        @select="handleSelect"
      >
        <el-menu-item index="/">首页</el-menu-item> 
        <el-menu-item index="/Material"  >我要找</el-menu-item>
        <el-menu-item index="/Workbench" >工作台</el-menu-item>
      </el-menu> 
    </template>
    <script>
    export default {
      data() {
        return {
          activeIndex: this.$route.path
        };
      },
    
      watch:{
        '$route'(to,from){
          this.activeIndex=to.path
        }
      },
      mounted(){
    
      },
      methods: { 
        handleSelect(key, keyPath) {
        }
      }
    };
    </script>
  • 相关阅读:
    OC
    OC
    OC
    OC
    OC
    Oracle wm_concat()函数
    字符串拼接
    easyui扩展数据表格点击加号拓展
    子tab里面新增tab(top.jQuery)
    combox datagrid重复请求问题
  • 原文地址:https://www.cnblogs.com/aknife/p/12503616.html
Copyright © 2011-2022 走看看