<template>
  <div class="bool">
    <div class="left">
      <h3>判断题</h3>
      <div
        class="header"
        v-html="Data.content"
      >
      </div>
      <div class="body">
        <p>正确答案：</p>
        <div class="radio">
          <div
            class="item"
            v-for="(item,index) in Data.value"
            :key="index"
          >
            <span :class="{'foucs':item.state}"></span>
            <span class="font">{{item.label}}</span>
          </div>
        </div>
        <p>选中答案：</p>
        <div class="radio">
          <div
            class="item"
            v-for="(item,index) in Data.values"
            :key="index"
          >
            <span :class="{'foucss':item.state}"></span>
            <span class="font">{{item.label}}</span>
          </div>
        </div>
      </div>
    </div>
    <div
      v-if="State"
      class="right"
    >
      <div class="header">{{Data.header}}</div>
      <div class="body"><span style="font-weight:bold;">解析：</span>
        <div class="desc">{{Data.desc}}</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    //状态  答题 查看答案
    State: {
      type: Boolean,
      default: false
    },
    // 题
    //  {
    //     id: 3,
    //     type: "bool",
    //     content: "<p>结合xxx特征<p>",
    //     result: {
    //       yes: ["正确答案", "正确答案"],
    //       no: ["错误答案", "错误答案"],
    //     }
    //   }
    Data: {
      type: Object,
      default: {}
    }
  },
  data () {
    return {
    }
  },
  created () {

  },
  methods: {

  }
}
</script>
<style lang="less" scoped>
// 单选按钮
.radio {
  display: flex;
  align-items: center;
  .item {
    margin-right: 10px;
    display: flex;
    align-items: center;
    & > span:first-child {
      display: inline-block;
      width: 20px;
      height: 20px;
      box-sizing: border-box;
      border-radius: 50%;
      border: 5px solid #eee;
      background-color: #dadada;
      margin-right: 5px;
    }
    .foucs {
      background-color: #67c23a !important;
    }
    .foucss {
      background-color: #f03 !important;
    }
  }
}
.bool {
  display: flex;
  .left {
    width: 100%;
    h3 {
      margin-top: 0;
    }
    .body {
      margin: 5px 0;
    }
  }
  .right {
    width: 400px;
    background-color: #f4f7ed;
    .header {
      padding: 10px;
      line-height: 20px;
      border-bottom: 1px solid #fff;
    }
    .body {
      padding: 10px;
      .desc {
        margin-top: 10px;
        width: 100%;
        height: 100%;
        line-height: 24px;
      }
    }
  }
}
</style>