mirror of
https://github.com/wechat-article/wechat-article-exporter.git
synced 2026-06-09 00:52:41 +08:00
33 lines
594 B
Vue
33 lines
594 B
Vue
<template>
|
|
<UDropdown :items="items" :popper="{ placement: 'bottom-start' }">
|
|
<slot>
|
|
<UButton color="white" label="导出" trailing-icon="i-heroicons-chevron-down-20-solid" />
|
|
</slot>
|
|
</UDropdown>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const emit = defineEmits();
|
|
|
|
interface Item {
|
|
label: string;
|
|
event: string;
|
|
disabled?: boolean;
|
|
}
|
|
interface Props {
|
|
items: Item[];
|
|
}
|
|
|
|
const props = defineProps<Props>();
|
|
|
|
const items = [
|
|
props.items.map(item => ({
|
|
label: item.label,
|
|
click() {
|
|
emit(item.event);
|
|
},
|
|
disabled: item.disabled,
|
|
})),
|
|
];
|
|
</script>
|