<template>
  <a-input @keydown="handleKeyDown">
    <template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
      <slot :name="item" v-bind="data || {}"> </slot>
    </template>
  </a-input>
</template>
<script lang="ts">
  import { defineComponent } from 'vue';

  export default defineComponent({
    name: 'NsInput',
    setup() {
      const handleKeyDown = (event: KeyboardEvent) => {
        // Check if the pressed key is a space
        if (event.code === 'Space') {
          event.preventDefault();
        }
      };
      return {
        handleKeyDown,
      };
    },
  });
</script>
<style lang="less" scoped></style>
