<!--
 * @Descripttion:
 * @Version: 1.0
 * @Author: +C
 * @Date: 2022-02-17 12:54:27
 * @LastEditors: +C
 * @LastEditTime: 2022-02-18 14:54:13
-->

<template>
  <vxe-radio-group v-if="!isDetail" v-bind="$attrs" v-on="$listeners">
    <slot></slot>
  </vxe-radio-group>
  <span v-else>{{ formVal }} </span>
</template>

<script>
import formComponents from "./formComponents"
export default {
  name: 'DxxRadioGroup',
  //页面引用的组件
  components: {},
  //继承表单父组件
  extends: formComponents,
  //父页面传递参数
  props: {},
  data() {
    return {};
  },
  //监控计算变量
  computed: {
    // 计算属性的
    formVal: function () {
      //找出radio对应的option项
      let selectVal = this.$slots.default.filter((item) => {
        return item.data.attrs.label == this.$attrs.value
      })
      //详细中 单选框下拉的值
      let radioVal = selectVal.length > 0 ? selectVal[0].data.attrs.content : ''
      return radioVal
    }
  },
  //监听
  watch: {},
  //页面的构造方法
  created() { },
  //父页面定义方法给子页面inject调用
  providee() { return {} },
  //子组件调用注入到父页面providee
  inject: [],
  //dom加载完
  mounted() {
  },
  //页面的自定义方法
  methods: {

  }
};
</script>

<style scoped>
</style>
