<template>
    <Tooltip   placement="bottom-start">
        <div v-show="showFlag" :class="extClass" class="btn-icon-item btnItem pull-left" @click="btnClick">
            <div class="goIconBtn">
                <i :title="btnItemObj.text||''" :class="btnItemObj.img" :style="iconStyle" ></i>
            </div>
        </div>
        <div slot="content">
            <div v-html="content"></div>
        </div>
    </Tooltip>
</template>

<script>

    import {AssertUtils} from "goingutils";
    import btnMixin from './mixins/btnMixin';

    export default {
        name: "goIconBtn",
        mixins: [btnMixin],
        props: {
            content:{},
            btnItem: {
                type: Object,
                default: null
            },
            size: {},
            color: {},
        },
        computed: {
            extClass(){
                return this.disabled?'disabled':'';
            },
            iconStyle(){
                let def={};
                //如果传入了字体颜色
                if(AssertUtils.isNotEmpty(this.btnItemObj["color"])){
                    def["color"]=this.btnItemObj["color"];
                }
                //如果传入了字体大小
                if(AssertUtils.isNotEmpty(this.btnItemObj["size"])){
                    def["fontSize"]=this.btnItemObj["size"];
                }
                return def;
            },
        },
        methods: {

        },
        mounted() {
        },
        components: {},
        watch: {

        }
    };
</script>

