0000
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
<template>
|
||||
<a-modal v-model:visible="modal.visible" :on-before-ok="modal.submit" unmount-on-close @cancel="modal.cancel" :width="width">
|
||||
<a-modal
|
||||
v-model:visible="modal.visible"
|
||||
:on-before-ok="modal.submit"
|
||||
unmount-on-close
|
||||
@cancel="modal.cancel"
|
||||
:width="width"
|
||||
:on-before-cancel="modal.customCancel"
|
||||
>
|
||||
<template #title>
|
||||
{{ prop.title }}
|
||||
</template>
|
||||
@@ -25,7 +32,9 @@ const prop = defineProps({
|
||||
default_visible: { type: Boolean, default: false }, // 默认隐藏
|
||||
options: { type: Object, default: {} }, // ma-form 属性
|
||||
submit: { type: Function, default: () => {} },
|
||||
width :{ type:String, default:("1000"+'px')}
|
||||
width: { type: String, default: "1000" + "px" },
|
||||
// 自定义异步取消参数
|
||||
customCancel: { type: Function, default: null }
|
||||
})
|
||||
|
||||
const maFormRef = ref()
|
||||
@@ -50,6 +59,12 @@ const modal = reactive({
|
||||
}
|
||||
return prop.submit(form._rawValue)
|
||||
},
|
||||
customCancel() {
|
||||
if(prop.customCancel){
|
||||
return prop.customCancel()
|
||||
}
|
||||
return true
|
||||
},
|
||||
cancel() {
|
||||
emit("cancel")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user