fix(layout->user-dropdown): resolve warning "Invalid prop name: key is a reserved property" (#3640)

closed #3639
This commit is contained in:
Zhong 2024-03-02 10:07:41 +08:00 committed by GitHub
parent ca3ddd19f7
commit eae68bb029
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,13 +14,11 @@
defineOptions({ name: 'DropdownMenuItem' });
const props = defineProps({
// eslint-disable-next-line
key: propTypes.string,
defineProps({
text: propTypes.string,
icon: propTypes.string,
});
const instance = getCurrentInstance();
const itemKey = computed(() => props.key || instance?.vnode?.props?.key);
const itemKey = computed(() => instance?.vnode?.props?.key);
</script>