You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

29 lines
720 B

<script lang="ts" setup>
2 years ago
import { MenuItem } from 'ant-design-vue'
import { computed, getCurrentInstance } from 'vue'
2 years ago
import { Icon } from '@/components/Icon'
2 years ago
import { propTypes } from '@/utils/propTypes'
defineOptions({ name: 'DropdownMenuItem' })
2 years ago
const props = defineProps({
2 years ago
// eslint-disable-next-line vue/no-reserved-props
2 years ago
key: propTypes.string,
text: propTypes.string,
icon: propTypes.string,
2 years ago
})
const instance = getCurrentInstance()
const itemKey = computed(() => props.key || instance?.vnode?.props?.key)
</script>
<template>
<MenuItem :key="itemKey">
<span class="flex items-center">
<Icon :icon="icon" class="mr-1" />
<span>{{ text }}</span>
</span>
</MenuItem>
</template>