<script setup>
import { ref } from 'vue'
import useStyle from '../hooks/useStyle'
defineOptions({
  name: 'VInputNumber'
})

const root = ref(null)

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

const model = defineModel({ type: Number })

const { style } = useStyle(props)

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

<template>
  <el-input-number ref="root" v-model.trim="model" v-bind="field" :style="style">
  </el-input-number>
</template>

<style scoped>
</style>