提交 6015af20 编写于 作者: C Captain.B

header v-permission

上级 c715ebd4
...@@ -7,8 +7,13 @@ ...@@ -7,8 +7,13 @@
:default-active="activeIndex" :default-active="activeIndex"
@select="handleSelect" @select="handleSelect"
router> router>
<el-menu-item index="1">功能测试</el-menu-item> <el-menu-item index="1" v-permission="['test_manager','test_user','test_viewer']">
<el-menu-item index="/createTest" onselectstart="return false">性能测试</el-menu-item> 功能测试
</el-menu-item>
<el-menu-item index="/createTest" onselectstart="return false"
v-permission="['test_manager','test_user','test_viewer']">
性能测试
</el-menu-item>
<el-menu-item index="/setting" onselectstart="return false">系统设置</el-menu-item> <el-menu-item index="/setting" onselectstart="return false">系统设置</el-menu-item>
</el-menu> </el-menu>
</template> </template>
...@@ -22,15 +27,15 @@ ...@@ -22,15 +27,15 @@
} }
}, },
watch: { watch: {
'$route' () { '$route'() {
this.handleSelect(this.activeIndex); this.handleSelect(this.activeIndex);
} }
}, },
mounted () { mounted() {
this.activeIndex = this.$route.matched[0].path || '/' this.activeIndex = this.$route.matched[0].path || '/'
}, },
methods: { methods: {
handleSelect (index) { handleSelect(index) {
this.activeIndex = index this.activeIndex = index
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册