fix: Modal拖拽参数传递
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
import { ref, watch, watchEffect, CSSProperties, computed } from 'vue';
|
import { ref, watch, watchEffect, CSSProperties, computed } from 'vue';
|
||||||
import { useDraggable } from '@vueuse/core';
|
import { useDraggable } from '@vueuse/core';
|
||||||
const emit = defineEmits(['update:visible', 'ok', 'cancel']);
|
const emit = defineEmits(['update:visible', 'ok', 'cancel']);
|
||||||
|
/**于a-modal保持一致 */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
/**是否弹出显示,必传 */
|
/**是否弹出显示,必传 */
|
||||||
visible: {
|
visible: {
|
||||||
@@ -18,11 +19,37 @@ const props = defineProps({
|
|||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
default: '520px',
|
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: {
|
confirmLoading: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
footer: {
|
||||||
|
type: Object,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// 对标题进行监听
|
// 对标题进行监听
|
||||||
@@ -96,10 +123,14 @@ watch(
|
|||||||
<template>
|
<template>
|
||||||
<a-modal
|
<a-modal
|
||||||
:width="props.width"
|
:width="props.width"
|
||||||
:keyboard="false"
|
:keyboard="props.keyboard"
|
||||||
:mask-closable="false"
|
:mask-closable="props.maskClosable"
|
||||||
:visible="props.visible"
|
:visible="props.visible"
|
||||||
:confirm-loading="props.confirmLoading"
|
: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)"
|
@ok="e => emit('ok', e)"
|
||||||
@cancel="e => emit('cancel', e)"
|
@cancel="e => emit('cancel', e)"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user