未验证 提交 b84cc5eb 编写于 作者: B bingzhe 提交者: GitHub

fix(Modal): repair cancel event missing (#1545)

上级 f015a874
......@@ -10,7 +10,7 @@ export default defineComponent({
inheritAttrs: false,
props: basicProps,
emits: ['cancel'],
setup(props, { slots }) {
setup(props, { slots, emit }) {
const { visible, draggable, destroyOnClose } = toRefs(props);
const attrs = useAttrs();
useModalDragMove({
......@@ -19,8 +19,12 @@ export default defineComponent({
draggable,
});
const onCancel = (e: Event) => {
emit('cancel', e);
};
return () => {
const propsData = { ...unref(attrs), ...props } as Recordable;
const propsData = { ...unref(attrs), ...props, onCancel } as Recordable;
return <Modal {...propsData}>{extendSlots(slots)}</Modal>;
};
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册