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