2020-12-31 11:47:52 +08:00
|
|
|
<template>
|
|
|
|
<template v-for="val in chil">
|
|
|
|
<el-submenu :index="val.path" :key="val.path" v-if="val.children && val.children.length > 0">
|
|
|
|
<template #title>
|
|
|
|
<i :class="val.meta.icon"></i>
|
2021-01-18 11:06:36 +08:00
|
|
|
<span>{{ val.meta.title }}</span>
|
2020-12-31 11:47:52 +08:00
|
|
|
</template>
|
|
|
|
<sub-item :chil="val.children" />
|
|
|
|
</el-submenu>
|
|
|
|
<el-menu-item :index="val.path" :key="val.path" v-else>
|
|
|
|
<i :class="val.meta.icon ? val.meta.icon : ''"></i>
|
2021-01-18 11:06:36 +08:00
|
|
|
<template v-if="!val.meta.isLink">
|
|
|
|
<span>{{ val.meta.title }}</span>
|
|
|
|
</template>
|
2020-12-31 11:47:52 +08:00
|
|
|
<template v-else><a :href="val.meta.isLink" target="_blank">{{ val.meta.title }}</a></template>
|
|
|
|
</el-menu-item>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { computed, defineComponent } from "vue";
|
|
|
|
export default defineComponent({
|
|
|
|
name: "navMenuSubItem",
|
|
|
|
props: {
|
|
|
|
chil: {
|
|
|
|
type: Array,
|
|
|
|
default() {
|
|
|
|
return [];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setup(props) {
|
2021-01-24 21:53:46 +08:00
|
|
|
// 获取父级菜单数据
|
2020-12-31 11:47:52 +08:00
|
|
|
const chil = computed(() => {
|
|
|
|
return props.chil;
|
|
|
|
});
|
|
|
|
return {
|
|
|
|
chil,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|