You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB

7 months ago
<!-- @format -->
<template>
<a-modal v-bind="getBindValue" centered>
7 months ago
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
<slot :name="item" v-bind="data || {}"></slot>
</template>
</a-modal>
</template>
<script lang="ts">
import { computed, defineComponent, toRefs } from 'vue';
import { useModalDrag } from '/nerv-lib/component/modal/useModalDrag';
import { modalProps } from 'ant-design-vue/es/modal/Modal';
export default defineComponent({
name: 'NsModal',
props: {
...modalProps(),
draggable: {
type: Boolean,
default: true,
},
searchData: {
type: Object,
default: () => ({}),
},
},
setup(props, { attrs, emit }) {
const { visible, draggable, destroyOnClose } = toRefs(props);
useModalDrag({
visible,
destroyOnClose,
draggable,
});
const getBindValue = computed(() => ({
...attrs,
...props,
}));
return { getBindValue };
},
});
</script>
<style lang="less" scoped></style>