fix: Modal拖拽参数传递

This commit is contained in:
TsMask
2023-11-25 15:28:31 +08:00
parent 133affa551
commit 4c06ddd5f9

View File

@@ -2,6 +2,7 @@
import { ref, watch, watchEffect, CSSProperties, computed } from 'vue';
import { useDraggable } from '@vueuse/core';
const emit = defineEmits(['update:visible', 'ok', 'cancel']);
/**于a-modal保持一致 */
const props = defineProps({
/**是否弹出显示,必传 */
visible: {
@@ -18,11 +19,37 @@ const props = defineProps({
type: [String, Number],
default: '520px',
},
/**确认按钮加载 */
bodyStyle: {
type: Object,
default: {},
},
keyboard: {
type: Boolean,
default: true,
},
mask: {
type: Boolean,
default: true,
},
maskClosable: {
type: Boolean,
default: true,
},
maskStyle: {
type: Object,
default: {},
},
destroyOnClose: {
type: Boolean,
default: false,
},
confirmLoading: {
type: Boolean,
default: false,
},
footer: {
type: Object,
},
});
// 对标题进行监听
@@ -96,10 +123,14 @@ watch(
<template>
<a-modal
:width="props.width"
:keyboard="false"
:mask-closable="false"
:keyboard="props.keyboard"
:mask-closable="props.maskClosable"
:visible="props.visible"
:confirm-loading="props.confirmLoading"
:body-style="props.bodyStyle"
:mask-style="props.maskStyle"
:destroy-on-close="props.destroyOnClose"
:footer="props.footer"
@ok="e => emit('ok', e)"
@cancel="e => emit('cancel', e)"
>