<!-- @format -->

<template>
  <a-drawer v-bind="getBindValue">
    <template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
      <slot :name="item" v-bind="data || {}"></slot>
    </template>
    <template #footer>
      <a-button>取消</a-button>
    </template>
  </a-drawer>
</template>

<script lang="ts">
  import { computed, defineComponent, toRefs } from 'vue';
  import { drawerProps } from 'ant-design-vue/es/drawer';

  export default defineComponent({
    name: 'NsDrawer',
    props: {
      ...drawerProps(),
    },
    setup(props, { attrs, emit, slots }) {
      console.log(props, slots);

      const getBindValue = computed(() => ({
        ...attrs,
        ...props,
      }));
      return { getBindValue };
    },
  });
</script>
<style lang="less" scoped></style>
