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.

65 lines
1.4 KiB

3 years ago
<template>
<el-menu class="top-menu"
:default-active="activeIndex"
mode="horizontal"
text-color="#333">
3 years ago
<el-menu-item index="0" @click.native="openHome(itemHome)">
3 years ago
<template #title>
3 years ago
<i :class="itemHome.source" style="padding-right: 5px;"></i>
<span>{{itemHome.name}}</span>
</template>
</el-menu-item>
<template v-for="(item,index) in items" :key="index">
<el-menu-item :index="item.id+''"
@click="openMenu(item)">
<template #title >
<i :class="item.source" style="padding-right: 5px;"></i>
<span>{{item.name}}</span>
3 years ago
</template>
</el-menu-item>
</template>
</el-menu>
</template>
<script>
import { mapGetters } from "vuex";
export default {
name: "top-menu",
data () {
return {
3 years ago
itemHome: {
name: '首页',
source: 'iconfont iconicon_work',
},
3 years ago
activeIndex: "0",
items: []
};
},
inject: ["index"],
created () {
3 years ago
this.getMenu();
3 years ago
},
computed: {
...mapGetters(["tagCurrent", "menu"])
},
methods: {
openMenu (item) {
this.index.openMenu(item)
},
3 years ago
openHome(itemHome) {
this.index.openMenu(itemHome);
this.$router.push({
path: this.website.fistPage
});
},
getMenu() {
3 years ago
this.$store.dispatch("GetTopMenu").then(res => {
this.items = res;
});
},
}
};
3 years ago
</script>