<template>
    <div class="row  go-form-row flex-div" :style="extendStyle">
        <go-label   :labelSplit="labelFlag"
                    :showLabel="labelFlag"
                    :showSlot="inputItem.showLabelSlot" :item="inputItem"></go-label>
        <div class="go-content padding-l-bs">
            <div v-if="item != null && item.content != null && item.content.length > 0" style="color:#007F66">
                {{ item.content }}
            </div>
            <div v-else>
                <slot></slot>
            </div>
        </div>
    </div>
</template>

<script>
    import formMixin from "../../mixins/formMixins";
    import GoLabel from "./commponents/go-label";
    import {AssertUtils} from "goingutils";

    export default {
        name: "go-explain",
        mixins: [formMixin],
        props: {
            //行高
            rowHeight: {
                type: Number,
                default:0
            },
            showLabel: {
                type: Boolean,
                default:true
            },
            value: {},
            width: {
                type: [String, Number],
                default: "big"
            },
            item: {
                type: Object,
                default: () => {
                }
            }
        },
        methods: {},
        computed:{
            extendStyle(){
                if(this.rowHeight>0){
                    return {height: this.rowHeight+"px",lineHeight: this.rowHeight+"px",minHeight: this.rowHeight+"px",padding: 0,margin: 0};
                }else{
                    return {};
                }
            },
            //判断是否显示label 以及是否显示split
            labelFlag(){
                if(AssertUtils.isNotEmpty(this.inputItem["label"])){
                    return true;
                }else{
                    return false;
                }
            },
        },
        mounted() {
        },
        components: {
            GoLabel,
        }
    };
</script>
