dingdong-mall/components/ms-dropdown/dropdown-menu.vue

37 lines
498 B
Vue
Raw Permalink Normal View History

2026-03-13 14:26:44 +08:00
<template>
<div class="dropdown-menu">
<slot></slot>
</div>
</template>
<script>
export default {
data() {
return {
}
},
mounted() {
this.$on('close', this.closeDropdown)
},
methods: {
closeDropdown() {
this.$children.forEach(item =>{
item.close();
})
}
}
}
</script>
<style scoped>
.dropdown-menu {
display: flex;
overflow: auto;
white-space: nowrap;
margin-right: 5px;
}
dropdown-item {
flex: 1;
}
</style>