<script setup>
import { ref } from 'vue'
import useStyle from '../hooks/useStyle'

defineOptions({
  name: 'VTimeSelect'
})

const root = ref(null)

const props = defineProps({
  field: {
    type: Object,
    required: true
  }
})

const model = defineModel({ type: String })

const { style } = useStyle(props)

defineExpose({
  root,
  focus() {
    root.value.focus()
  },
  blur() {
    root.value.blur()
  }
})
</script>

<template>
  <el-time-select ref="root" v-model="model" v-bind="field" :style="style" />
</template>

<style scoped>
</style>