<template>
  <input
    :ref="setInputRef"
    maxlength="1"
    class="sk-code-input"
    @input="$emit('input', $event)"
    @keyup.delete="$emit('delete')"
  >
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
  name: 'SkCodeInputItem',
  props: {
    size: {
      type: Number,
      default: 6,
    },
  },
  setup(props) {
    let setInputRef = null

    const handleInput = (event, index) => {

    }
    const handleDel = index => {
      if (index > 1) {
        inputNodes[index - 2].focus()
      }
    }
    const focus = () => {
      setInputRef.focus()
    }
    return {
      setInputRef,
      handleInput,
      handleDel,
    }
  },
})
</script>
<style lang="scss" scoped>

</style>
