2020-12-15 00:13:23 +08:00
|
|
|
<template>
|
2023-11-23 12:14:06 +08:00
|
|
|
<Menu.Item :key="itemKey">
|
2020-12-15 00:13:23 +08:00
|
|
|
<span class="flex items-center">
|
|
|
|
|
<Icon :icon="icon" class="mr-1" />
|
|
|
|
|
<span>{{ text }}</span>
|
|
|
|
|
</span>
|
2023-11-23 12:14:06 +08:00
|
|
|
</Menu.Item>
|
2020-12-15 00:13:23 +08:00
|
|
|
</template>
|
2023-11-23 12:14:06 +08:00
|
|
|
<script lang="ts" setup>
|
2021-02-19 22:15:02 +08:00
|
|
|
import { Menu } from 'ant-design-vue';
|
2023-11-23 12:14:06 +08:00
|
|
|
import { computed, getCurrentInstance } from 'vue';
|
2023-04-06 23:16:15 +08:00
|
|
|
import Icon from '@/components/Icon/Icon.vue';
|
2023-11-23 12:14:06 +08:00
|
|
|
import { propTypes } from '@/utils/propTypes';
|
2020-12-15 00:13:23 +08:00
|
|
|
|
2023-11-23 12:14:06 +08:00
|
|
|
defineOptions({ name: 'DropdownMenuItem' });
|
2020-12-15 00:13:23 +08:00
|
|
|
|
2023-11-23 12:14:06 +08:00
|
|
|
const props = defineProps({
|
|
|
|
|
// eslint-disable-next-line
|
|
|
|
|
key: propTypes.string,
|
|
|
|
|
text: propTypes.string,
|
|
|
|
|
icon: propTypes.string,
|
2020-12-15 00:13:23 +08:00
|
|
|
});
|
2023-11-23 12:14:06 +08:00
|
|
|
|
|
|
|
|
const instance = getCurrentInstance();
|
|
|
|
|
const itemKey = computed(() => props.key || instance?.vnode?.props?.key);
|
2020-12-15 00:13:23 +08:00
|
|
|
</script>
|