<template>
  <n-modal v-bind="getModalOptions" preset="dialog">
    <n-card>
      <slot name="Context" />
    </n-card>
  </n-modal>
</template>

<script>

import { defineComponent, computed, unref } from 'vue'
export default defineComponent({
  name: 'ModalModules',
  props: {
    options: {
      type: Object,
      default: () => {}
    }
  },
  emits: {
    click: null, // click事件没有检验
    onClose: (value) => {
      return value
    }
  },
  setup(props, { emit }) {
    const getModalOptions = computed(() => {
      return unref(props.options)
    })
    console.log(getModalOptions)
    const handleClick = function() {
      emit('click')
    }
    const handleCancel = function() {
      emit('onClose', true)
    }
    return {
      getModalOptions,
      handleClick,
      handleCancel
    }
  }
})
</script>

<style scoped lang='scss'>
</style>
