<template>
    <div class="app-panel-button">
        <Button type="primary" long @click="onClick" :style="buttonStyle" :disabled="disabled" :title="tooltip">
            <i v-if="icon" :class="icon"></i>
            <img v-else-if="imagePath" :src="imagePath" alt="">
            <span v-if="showCaption" :class="lableStyle">{{caption ? caption : ''}}</span>
        </Button>
    </div>
</template>

<script lang="ts">
import { Vue, Component, Prop } from "vue-property-decorator";

@Component({})
export default class AppPanelButton extends Vue {

    /**
     * 图标
     *  
     * @type {string}
     * @memberof AppPanelButton
     */
    @Prop() icon?: string;

    /**
     * 标题
     *  
     * @type {string}
     * @memberof AppPanelButton
     */
    @Prop() caption?: string;

    /**
     * 显示标题
     *  
     * @type {boolean}
     * @memberof AppPanelButton
     */
    @Prop() showCaption?: boolean;

    /**
     * 标题样式
     *  
     * @type {string}
     * @memberof AppPanelButton
     */
    @Prop() lableStyle?: string;

    /**
     * 按钮样式
     * 
     * @memberof AppPanelButton
     */
    @Prop() buttonStyle?: any;

    /**
     * 按钮提示
     * 
     * 
     * @memberof AppPanelButton
     */
    @Prop() tooltip?: string;

    /**
     * 图片路径
     * 
     * 
     * @memberof AppPanelButton
     */
    @Prop() imagePath?: string;

    /**
     * 禁用状态
     * 
     * @memberof AppPanelButton
     */
    @Prop({default : false}) disabled?: boolean;

    /**
     * 点击按钮
     *
     * @param {*} $event
     * @memberof AppPanelButton
     */
    onClick($event: any){
        this.$emit('onClick',$event);
    }

}
</script>
<style lang='less'>

</style>