【更新】调整XnFormContainer

pull/103/head^2
xlzy 2023-03-25 17:41:16 +08:00 committed by 小诺
parent 23d0791e4e
commit 7384ed0ce3
1 changed files with 5 additions and 14 deletions

View File

@ -1,20 +1,17 @@
<template>
<Modal v-if="isModal" :visible="visible" @cancel="cancel" 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>
</Modal>
<Drawer v-else :visible="visible" v-bind="$attrs" :footer-style="{ textAlign: 'right' }">
</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" />
</template>
</Drawer>
</a-drawer>
</template>
<script>
import { Drawer, Modal } from 'ant-design-vue'
import { modalProps } from 'ant-design-vue/es/modal/Modal'
import { drawerProps } from 'ant-design-vue/es/drawer'
import { mapState } from 'pinia'
import { globalStore } from '@/store'
@ -24,19 +21,13 @@
}
export default {
name: 'XnFormContainer',
components: {
Drawer,
Modal
},
inheritAttrs: false,
props: {
visible: {
type: Boolean,
default: false,
required: true
},
...modalProps,
...drawerProps
}
},
computed: {
...mapState(globalStore, ['formStyle']),