<template>
    <div class="o_box">
        <div class="o_box_title">
            <div>标题</div>
            <div>{{ title }}</div>
        </div>
        <div class="o_box_topic">
            <div class="o_box_child" v-for="(item, index) in checkJson" :key="index" :class="{active:checkType == index}" @click="setType(index)">
                <span>{{ index + 1  }}.{{ item.content }}</span>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        title: {
            type: String,
        },
        detail: {
            type: String,
        }, 
        checkJson: {
            type: Array,
        }, 
        checkType: {
            type: Number,
        },
    },
    methods: {
        setType(index) {
            this.$emit('setType', index)
        }
    },


}

</script>

<style scoped>
.o_box{
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 20px 15px;
    box-sizing:border-box;
}
.o_box_title{
    width:100%;
    margin-bottom: 25px;
}
.o_box_title > div + div{
    margin-top: 8px;
}

.o_box_title > div:nth-child(1){
 color: #00000066;
 font-size: 14px;
 letter-spacing: 6px;
}
.o_box_title > div:nth-child(2){
    color:#3981FA;
    font-size: 24px;
    font-style: italic;
}

.o_box_topic{
    background: #dce9ff;
    padding: 15px 10px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
}
.o_box_child{
    height: 42px;
    display: flex;
    align-items: center;
    color: #3681FC;
    border-radius: 10px;
    background: #fff;
    /* border: 2px solid #3681FC; */
    margin-bottom: 10px;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    cursor: pointer;
}
.o_box_child.active{
    background: #3681FC;
    color: #fff;
}

.o_box_child > span{
    width: 100%;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-wrap: break-word;
}
</style>