<template>
  <span v-if="isLook">{{ select_look || '-' }}</span>
  <el-radio-group v-else v-model="select" :disabled="disabled">
    <el-radio v-for="item in options" :key="item[field.value]" :value="item[field.value]">
      {{ item[field.label] }}
    </el-radio>
  </el-radio-group>
</template>

<script setup lang="ts">
import { useOptions } from '../hooks/useOptions'

const props = defineProps({
  modelValue: {
    type: [String, Number],
    default: () => ''
  },
  mode: {
    type: String,
    default: 'add'
  },
  formItem: {
    type: Object,
    default: () => {}
  },
  disabled: {
    type: Boolean,
    default: false
  }
})

const emits = defineEmits(['update:modelValue'])

const { options, field, isLook, select_look, select } = useOptions(props, emits)
</script>
