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)"
|
@click="handleClickMenu(item)"
|
||||||
:disabled="item.disabled"
|
: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" />
|
<Icon :icon="item.icon" v-if="item.icon" />
|
||||||
<span class="ml-1">{{ item.text }}</span>
|
<span class="ml-1">{{ item.text }}</span>
|
||||||
|
</div>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<Icon :icon="item.icon" v-if="item.icon" />
|
<Icon :icon="item.icon" v-if="item.icon" />
|
||||||
@ -34,6 +39,7 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { Dropdown, Menu, Popconfirm } from 'ant-design-vue';
|
import { Dropdown, Menu, Popconfirm } from 'ant-design-vue';
|
||||||
import { Icon } from '/@/components/Icon';
|
import { Icon } from '/@/components/Icon';
|
||||||
|
import { omit } from 'lodash-es';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'BasicDropdown',
|
name: 'BasicDropdown',
|
||||||
@ -78,6 +84,7 @@
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
handleClickMenu,
|
handleClickMenu,
|
||||||
|
omit,
|
||||||
getAttr: (key: string | number) => ({ key }),
|
getAttr: (key: string | number) => ({ key }),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user