<template>
  <LabelBox
    class="switch"
    :label="formItems.attrs?.label"
    :need-star="formItems.attrs?.needStar"
    :width="formItems.attrs?.width"
  >
    <el-switch
      v-model="value"
      size="mini"
      v-bind="formItems.attrs"
      @change="handleChangeEvent"
    />
  </LabelBox>
</template>

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

export default {
  components: {
    LabelBox,
  },
  props: {
    formItems: {
      type: Object,
      default: () => {},
    },
    value: {
      type: String,
      default: '',
    },
  },
};
</script>
<style lang="scss" scoped>
.switch {
  min-height: 28px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}
</style>

