x-php-Admin/src/components/XrMenu/index.vue

49 lines
765 B
Vue
Raw Normal View History

2023-07-09 14:34:43 +00:00
<template>
<div>
<xr-menu-item
v-for="(item, index) in list"
:key="index"
:label="item.label"
:name="item.name"
:icon-color="item.iconColor"
:icon-class="item.iconClass"
@click.native="menuClick(index)"/>
</div>
</template>
<script>
import XrMenuItem from './XrMenuItem'
export default {
// 菜单
name: 'XrMenu',
components: {
XrMenuItem
},
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>