mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-02-02 18:08:40 +08:00
fix(dropdown): icon and trigger work unexpected
修复Dropdown中popconfirm的事件响应区域以及icon不正常的问题 fix: #796,#787
This commit is contained in:
parent
9298b3c988
commit
60b80c96e8
@ -11,9 +11,14 @@
|
||||
@click="handleClickMenu(item)"
|
||||
:disabled="item.disabled"
|
||||
>
|
||||
<Popconfirm v-if="popconfirm && item.popConfirm" v-bind="item">
|
||||
<Popconfirm v-if="popconfirm && item.popConfirm" v-bind="omit(item.popConfirm, 'icon')">
|
||||
<template #icon v-if="item.popConfirm.icon">
|
||||
<Icon :icon="item.popConfirm.icon" />
|
||||
</template>
|
||||
<div>
|
||||
<Icon :icon="item.icon" v-if="item.icon" />
|
||||
<span class="ml-1">{{ item.text }}</span>
|
||||
</div>
|
||||
</Popconfirm>
|
||||
<template v-else>
|
||||
<Icon :icon="item.icon" v-if="item.icon" />
|
||||
@ -34,6 +39,7 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { Dropdown, Menu, Popconfirm } from 'ant-design-vue';
|
||||
import { Icon } from '/@/components/Icon';
|
||||
import { omit } from 'lodash-es';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'BasicDropdown',
|
||||
@ -78,6 +84,7 @@
|
||||
|
||||
return {
|
||||
handleClickMenu,
|
||||
omit,
|
||||
getAttr: (key: string | number) => ({ key }),
|
||||
};
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user