<template>
    <span class="operateBtnIcon  " :class="[$attrs.class,{disabled:disabled}]" @click.stop="iconClick"  >
        <template v-if="title">
            <el-tooltip :enterable="false"  :content="title" popper-class="operateBtnIconPopper" placement="bottom" effect="light">
                <slot></slot>
            </el-tooltip>
        </template>
        <template v-else>
            <slot></slot>
        </template>
    </span>
</template>

<script>
export default {
    inheritAttrs:false,
    props:{
        title:{
            type:String,
            default:"",
        },
        disabled:{
            type:Boolean,
            default:false
        }
    },
    methods:{
        iconClick(){
            if(!this.disabled){
                this.$emit('click')
            }
        }
    }
}
</script>

<style>

</style>