【更新】恢复XnFormContainer内的弹框组件

pull/150/head
xiaonuobase 2023-08-09 15:04:32 +08:00
parent 29633701d1
commit 8672389da2
1 changed files with 7 additions and 4 deletions

View File

@ -1,9 +1,9 @@
<template>
<drag-modal v-if="isModal" :visible="visible" v-bind="$attrs">
<a-modal v-if="isModal" :visible="visible" @cancel="cancel" v-bind="$attrs">
<template v-for="slotKey in slotKeys" #[slotKey]>
<slot :name="slotKey" />
</template>
</drag-modal>
</a-modal>
<a-drawer v-else :visible="visible" v-bind="$attrs" :footer-style="{ textAlign: 'right' }">
<template v-for="slotKey in slotKeys" #[slotKey]>
<slot :name="slotKey" />
@ -14,7 +14,6 @@
<script>
import { mapState } from 'pinia'
import { globalStore } from '@/store'
import DragModal from '@/components/DragModal/index.vue'
const FormContainerTypeEnum = {
DRAWER: 'drawer',
@ -22,7 +21,6 @@
}
export default {
name: 'XnFormContainer',
components: { DragModal },
inheritAttrs: false,
props: {
visible: {
@ -39,6 +37,11 @@
isModal() {
return FormContainerTypeEnum.MODAL === this.formStyle
}
},
methods: {
cancel() {
this.$emit('close')
}
}
}
</script>