push
This commit is contained in:
44
lib/component/modal/modal.vue
Normal file
44
lib/component/modal/modal.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<!-- @format -->
|
||||
|
||||
<template>
|
||||
<a-modal v-bind="getBindValue">
|
||||
<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>
|
||||
Reference in New Issue
Block a user