<template>
  <LabelBox
    :label="formItems.attrs?.label"
    :need-star="formItems.attrs?.needStar"
    :width="formItems.attrs?.width"
  >
    <el-cascader
      v-model="value"
      class="cascader"
      size="mini"
      :value="value"
      :options="formItems.options"
      :placeholder="formItems.attrs?.placeholder || '请选择'"
      v-bind="formItems.attrs"
      :props="{ expandTrigger: 'hover' }"
      v-on="formItems.events"
      @change="handleChangeEvent"
      @expand-change="handleExpandchangeEvent"
    />
  </LabelBox>
</template>

<script>
import LabelBox from '../labelBox/index.vue';
import fieldMixin from '../fieldMixin';

export default {
  components: {
    LabelBox,
  },
  mixins: [fieldMixin],
  props: {
    formItems: {
      type: Object,
      default: () => {},
    },
    value: {
      type: String,
      default: '',
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep.cascader {
  .el-input__inner {
    height: 24px;
    line-height: 24px;
  }
  .el-input__icon {
    width: 24px;
    height: 24px;
    line-height: 24px;
  }
}
::v-deep .el-cascader--mini {
  width: 100%;
}
</style>

