<template>
    <div class="go-label">
        <span><Radio v-model="radioValueTemp" @on-change="radioBoxClick">{{ item.label }}：</Radio></span>
    </div>
</template>

<script>
    import {GoingUtils} from 'goingutils';

    export default {
        name: "go-label-radio",
        data() {
            return {
                radioValueTemp: false
            };
        },
        props: {
            radioVal: {
                type: [Boolean,String],
                default: false
            },
            radioBox: {
                type:String,
                default: ""
            },
            item: {
                type: Object,
                default: () => {
                    return {};
                }
            }
        },
        computed: {},
        methods: {
            //设置drop的radio状态
            setRadioValue(radioState){
                this.radioValueTemp=radioState;
            },
            //radio点击事件
            radioBoxClick(data) {
                this.$emit("radioBoxClick", data);
            },
        },
        mounted() {
            this.radioValueTemp=GoingUtils.parseBoolean(this.radioVal);
        },
        watch:{
            radioVal(newVal){
                this.radioValueTemp=GoingUtils.parseBoolean(newVal);
            }
        },
        components: {}
    };
</script>
