<template>
  <div class="form-item-box" :style="{ width: width }">
    <el-select :disabled="disabled" v-model="sex" placeholder="请选择性别" @change="onChange">
      <el-option
        v-for="item in D_BZ_XB"
        :key="item"
        :label="item.zdmc"
        :value="item.dm"
      ></el-option>
    </el-select>
  </div>
</template>

<script setup>
import { COMPONENT_WIDTH } from "@/constant";
import {
  ref,
  defineProps,
  defineEmits,
  defineExpose,
  getCurrentInstance,
  onBeforeMount
} from "vue";
const { proxy } = getCurrentInstance();
const { D_BZ_XB } = proxy.$dict("D_BZ_XB");
const props = defineProps({
  //获取组件传值
  sex: {
    type: String
  },
  disabled:{
    type:Boolean,
    default:false
  },
  width: {
    default: COMPONENT_WIDTH,
    type: String
  }
});

const emits = defineEmits(["update:sex"]);
const onChange = (e) => {
  emits("update:sex", e);
};
</script>

<style lang="scss" scoped>
.manIcon,
.womanIcon {
  font-size: 30px;
}
</style>
