mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-25 02:58:43 +08:00
fix(Modal): repair cancel event missing (#1545)
This commit is contained in:
parent
f015a874e2
commit
b84cc5eb06
@ -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>;
|
||||
};
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user