Skip to content

Commit 6ef9404

Browse files
committed
fix: drawer handle slot trigger twice click event
1 parent 8baf85f commit 6ef9404

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/vc-drawer/src/Drawer.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import classnames from '../../_util/classNames';
2-
import { cloneVNode, Teleport, nextTick, defineComponent } from 'vue';
2+
import { Teleport, nextTick, defineComponent } from 'vue';
33
import BaseMixin from '../../_util/BaseMixin';
44
import { initDefaultProps, getSlot } from '../../_util/props-util';
55
import getScrollBarSize from '../../_util/getScrollBarSize';
@@ -15,6 +15,7 @@ import {
1515
isNumeric,
1616
} from './utils';
1717
import supportsPassive from '../../_util/supportsPassive';
18+
import { cloneElement } from 'ant-design-vue/es/_util/vnode';
1819

1920
function noop() {}
2021

@@ -417,9 +418,9 @@ const Drawer = defineComponent({
417418
const { handler: handlerSlot } = this;
418419
const handlerSlotVnode = handlerSlot || handlerDefalut;
419420
const handleIconClick = handlerSlotVnode.props && handlerSlotVnode.props.onClick;
420-
handlerChildren = cloneVNode(handlerSlotVnode, {
421+
handlerChildren = cloneElement(handlerSlotVnode, {
421422
onClick: e => {
422-
handleIconClick && handleIconClick();
423+
handleIconClick && handleIconClick(e);
423424
this.onIconTouchEnd(e);
424425
},
425426
ref: c => {

0 commit comments

Comments
 (0)