根据menu属性router来实现,

router属性:是否使用 vue-router 的模式,启用该模式会在激活导航时以 index 作为 path 进行路由跳转

将router的属性值设置为true即启用router属性。

<el-menu default-active="/main/dataSet" :router="true" class="el-menu-vertical-demo" background-color="#545c64" text-color="#fff"
          active-text-color="#ffd04b">
          <el-menu-item index="/main/dataSet">
            <i class="el-icon-reading"></i>
            <span slot="title">数据字典管理</span>
          </el-menu-item>
        </el-menu>

 

posted on 2021-12-05 09:58  周文豪  阅读(523)  评论(0编辑  收藏  举报