1. 程式人生 > >elementUI的導航欄怎麽根據路由默認選中相關項

elementUI的導航欄怎麽根據路由默認選中相關項

index active -m nav cti bstr -s str left

1.

<el-menu :default-active="this.$route.path.substr(1)" class="left-nav">

2.

el-submenu或者el-menu-item的index設置成路由對應的字符串 比如:路由為http://localhost:8080/#/project/list時,將需要被選中的el-submenu或者el-menu-item的index設置為 index="project/list"

elementUI的導航欄怎麽根據路由默認選中相關項