bladex前端ui项目,基于avue-cli2.0开发
包含基础工作流,不包含表单设计器
https://git.javablade.com/blade/Saber
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
50 lines
1.1 KiB
|
3 years ago
|
<template>
|
||
|
|
<el-menu class="top-menu"
|
||
|
|
:default-active="activeIndex"
|
||
|
|
mode="horizontal"
|
||
|
|
text-color="#333">
|
||
|
|
<template v-for="(item,index) in items"
|
||
|
|
:key="index">
|
||
|
|
<el-menu-item :index="item.parentId+''"
|
||
|
|
@click="openMenu(item)">
|
||
|
|
<template #title>
|
||
|
|
<i class="icon-caidan"></i>
|
||
|
|
<span>{{generateTitle(item)}}</span>
|
||
|
|
</template>
|
||
|
|
</el-menu-item>
|
||
|
|
</template>
|
||
|
|
</el-menu>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import { mapGetters } from "vuex";
|
||
|
|
export default {
|
||
|
|
name: "top-menu",
|
||
|
|
data () {
|
||
|
|
return {
|
||
|
|
activeIndex: "0",
|
||
|
|
items: []
|
||
|
|
};
|
||
|
|
},
|
||
|
|
inject: ["index"],
|
||
|
|
created () {
|
||
|
|
// this.getMenu();
|
||
|
|
},
|
||
|
|
computed: {
|
||
|
|
...mapGetters(["tagCurrent", "menu"])
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
openMenu (item) {
|
||
|
|
this.index.openMenu(item)
|
||
|
|
},
|
||
|
|
getMenu () {
|
||
|
|
this.$store.dispatch("GetTopMenu").then(res => {
|
||
|
|
this.items = res;
|
||
|
|
});
|
||
|
|
},
|
||
|
|
generateTitle (item) {
|
||
|
|
return this.$router.$avueRouter.generateTitle(item);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
};
|
||
|
|
</script>
|