2023-07-09 14:34:43 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
2023-07-10 07:54:42 +00:00
|
|
|
<x-menu-item
|
2023-07-09 14:34:43 +00:00
|
|
|
v-for="(item, index) in list"
|
|
|
|
:key="index"
|
|
|
|
:label="item.label"
|
|
|
|
:name="item.name"
|
|
|
|
:icon-color="item.iconColor"
|
|
|
|
:icon-class="item.iconClass"
|
2023-07-10 07:54:42 +00:00
|
|
|
@click="menuClick(index)"/>
|
2023-07-09 14:34:43 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-07-10 16:41:24 +00:00
|
|
|
import xMenuItem from './item'
|
2023-07-09 14:34:43 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
// 菜单
|
2023-07-10 16:41:24 +00:00
|
|
|
name: 'xMenu',
|
2023-07-09 14:34:43 +00:00
|
|
|
components: {
|
2023-07-10 16:41:24 +00:00
|
|
|
xMenuItem
|
2023-07-09 14:34:43 +00:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
value: {
|
|
|
|
type: [String, Number],
|
|
|
|
default: 0
|
|
|
|
},
|
|
|
|
list: Array
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {}
|
|
|
|
},
|
|
|
|
computed: {},
|
|
|
|
watch: {},
|
|
|
|
mounted() {},
|
|
|
|
|
|
|
|
beforeDestroy() {},
|
|
|
|
methods: {
|
|
|
|
menuClick(index) {
|
|
|
|
this.$emit('input', index)
|
|
|
|
this.$emit('select', index)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
</style>
|