<template>
  <el-radio-group v-model="radio" @change="change">
    <el-radio :label="1">启用</el-radio>
    <el-radio :label="0">禁用</el-radio>
  </el-radio-group>
</template>

<script setup>
  import { ref } from 'vue'
  const emit = defineEmits();
  const radio = ref(1)
  const props = defineProps({
    propConfig:{},
    propValue:{},
    parentValue:{}
  })
  const setValue = data => {
    radio.value = data
  }
  const change = () => {
    emit('onChange',radio.value);
  }

  defineExpose({
    setValue
  })

  if(props.propValue){
    setValue(props.propValue)
  }else{
    radio.value = 1
  }
  
  change()
</script>
<style lang="scss" scoped>

</style>