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

defineOptions({
  name: 'VRate'
})

const root = ref(null)

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

const model = defineModel({ type: Number })

const { style } = useStyle(props)

defineExpose({
  root,
  setCurrentValue(...rest) {
    root.value.setCurrentValue(...rest)
  },
  resetCurrentValue() {
    root.value.resetCurrentValue()
  }
})
</script>

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

<style scoped>
</style>