<template>
    <div>
        <!-- {{radiosData}} -->
        <el-radio-group v-model="newForm[item.english]">
          <el-radio v-for="(radio,index) in radiosData" :key="index" :label="radio.value" :disabled="!item.enabled" >{{radio.label}}</el-radio>
        </el-radio-group>
        <div v-if="newForm[item.explain]">{{ newForm[item.explain] }}</div>
    </div>
</template>

<script>

import { createDb } from '../utils/CommonRequest'

const $metiiAPI = createDb();

// console.log($metiiAPI.getconfigs);

export default {
    name: "metii-radio",
    data(){
        return {
            radiosData:[]
        }
    },
    props:{
        newForm: Object,
        item: Object
    },
    mounted() {
        this.getRaiodData()
    },
    methods:{
        getRaiodData(){
            $metiiAPI.getFormtData(this.item.sourcedata)
            .then(res => {
                this.radiosData = res
            })
        }
    }
}
</script>

<style lang="scss" scoped>

</style>