<template>
  <div class="radio">
    <div class="left">
      <h3>单选题 第{{Data.id}}题</h3>
      <div
        class="header"
        v-html="Data.content"
      >
      </div>
      <div class="body">
        <Radio
          :disabled="State"
          :Data="Data.value"
          :Value="value"
          @Func="Success"
        />
      </div>
    </div>
    <div
      v-if="State"
      class="right"
    >
      <div class="header">共错误3次，最后一次出错：2021-04-26 15:23，XXXXXX模拟考试</div>
      <div class="body">解析：
        XXXXXX</div>
    </div>
  </div>
</template>
<script>
const Radio = () => import("@/components/Radio/index");
export default {
  components: { Radio },
  props: {
    //状态  答题 查看答案
    State: {
      type: Boolean,
      default: false
    },
    // 题
    // {content:"富文本",result:{no:"做题答案",yes:"正确答案"},type:"radio",value:[{key:'A',label:'公园'}]}
    Data: {
      type: Object,
      default: {}
    }
  },
  data () {
    return {
      value: []
    }
  },
  created () {

  },
  methods: {
    // 获取选择的值
    Success (data) {
      this.value = data;
      this.$emit("Func", data);
    }
  },
}
</script>
<style lang="less" scoped>
.radio {
  display: flex;
  .left {
    width: 100%;
    h3 {
      margin-top: 0;
    }
    .body {
      margin: 15px 0;
    }
  }
  .right {
    width: 400px;
    background-color: #f4f7ed;
  }
}
</style>