<template>
  <el-checkbox-group v-model="localCheckList" :disabled="readonly" @change="val => $emit('change', val)">
    <el-checkbox
      v-for="item in dict.type[DictType.platform_activity_region_type]"
      :key="item.value"
      :value="item.value"
      :label="item.value"
    >
      {{ item.label }}
    </el-checkbox>
  </el-checkbox-group>
</template>

<script>
import DictType from '@/utils/dict/DictType'

export default {
  name: 'CheckClassRegion',
  dicts: [DictType.platform_activity_region_type],
  model: {
    prop: 'value',
    event: 'update:value'
  },
  props: {
    value: {
      type: Array,
      default: () => []
    },
    readonly: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      DictType
    }
  },
  computed: {
    localCheckList: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('update:value', val)
      }
    }
  }
}
</script>

<style scoped>

</style>
