<script lang="ts" setup>
import { getDict } from '@/utils/dict'

interface Props {
  modelValue: any
  type: string
}
const props = defineProps<Props>()
const emits = defineEmits(['update:modelValue'])

const modelValue = computed({
  get: () => props.modelValue,
  set: value => emits('update:modelValue', value)
})

const options = ref<any>([])
getDict(props.type).then(res => {
  options.value = res
})
</script>

<template>
  <el-select v-model="modelValue" clearable>
    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
  </el-select>
</template>

<style lang="scss" scoped></style>
