<template>
  <el-form-item :label="label" :rules="requireRule(required, label, validate)" :prop="prop">
      <el-radio-group  
      v-model="$parent.model[prop]"
      :disabled="disabled">
      <el-radio v-for="item in data" :key="item[`${valueProp}`]" :label="item[`${valueProp}`]">{{item[`${labelProp}`]}}</el-radio>
  </el-radio-group>
  <span style="margin-left:50px;">{{remark}}</span>
  </el-form-item>
</template>

<script>
import mixin from './mixin'
/**
 * 输入框组件
 */
export default {
  mixins: [mixin],
  props: {
    validate: {
      type: String
    },
    data: {
      type: Array,
      default: () => []
    },
    valueProp: {
      type: String,
      default: 'value'
    },
    labelProp: {
      type: String,
      default: 'label'
    },
    remark: {
      type: String,
      default: ''
    },
  }
}
</script>

<style>
.el-radio-group{
  width: 100%;
}
</style>
