zoukankan      html  css  js  c++  java
  • vue 使用element 刷新保持当前路由状态

    <el-menu
            :default-active="$route.path"
            @open="handleOpen"
            @close="handleClose"
            background-color="rgb(13,20,27)"
            text-color="#fff"
            active-text-color="rgb(0,236,228)"
            router
          >
            <el-menu-item index="/WaterSourceManage/WaterSourceProfile">
              <i class="el-icon-setting"></i>
              <span slot="title">111</span>
            </el-menu-item>
    <el-menu>

       (1) .要实现路由跳转,先要在el-menu标签上添加router属性,然后只要在每个el-menu-item标签内的index属性设置一下url即可实现点击el-menu-item实现路由跳转。
    2).导航当前项,在el-menu标签中绑定  :default-active="$route.path",注意是绑定属性,不要忘了加“:”,当$route.path等于el-menu-item标签中的index属性值时则该item为当前项。

  • 相关阅读:
    2017.10.17笔记
    鼠标移入移出方向判断
    12.14 css3
    百叶窗 蒙版 图层
    banner轮播
    12.13
    12.11 jq基础
    11.30 AJAX
    11.28 Window事件 iframe操作
    11.28.cookie
  • 原文地址:https://www.cnblogs.com/keai/p/11384666.html
Copyright © 2011-2022 走看看