<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 { nextTick, ref } from 'vue'
  const emit = defineEmits();
  const radio = ref(null)
  const props = defineProps({
    propConfig:{},
    propValue:{},
    parentValue:{}
  })
  const setValue = data => {
    radio.value = data
  }
  const change = () => {
    emit('onChange',radio.value);
  }
  defineExpose({
    setValue
  })

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

</style>