mirror of https://gitee.com/xiaonuobase/snowy
【更新】调整XnFormContainer
parent
23d0791e4e
commit
7384ed0ce3
|
@ -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']),
|
||||
|
|
Loading…
Reference in New Issue