app-panel-button.vue 1.2 KB
Newer Older
Shine-zwj's avatar
Shine-zwj committed
1
<template>
Shine-zwj's avatar
Shine-zwj committed
2
    <div class="app-panel-button">
3 4
        <Button type="primary" long @click="onClick">
            <i v-if="icon" :class="icon"></i>
Shine-zwj's avatar
Shine-zwj committed
5
            <span v-if="showCaption" :class="lableStyle">{{caption ? caption : ''}}</span>
6
        </Button>
Shine-zwj's avatar
Shine-zwj committed
7 8
    </div>
</template>
9

Shine-zwj's avatar
Shine-zwj committed
10 11 12 13
<script lang="ts">
import { Vue, Component, Prop, Watch } from "vue-property-decorator";

@Component({})
Shine-zwj's avatar
Shine-zwj committed
14
export default class AppPanelButton extends Vue {
Shine-zwj's avatar
Shine-zwj committed
15

16 17 18 19
    /**
     * 图标
     *  
     * @type {string}
Shine-zwj's avatar
Shine-zwj committed
20
     * @memberof AppPanelItem
21 22
     */
    @Prop() public icon?: string;
Shine-zwj's avatar
Shine-zwj committed
23

24 25 26 27
    /**
     * 标题
     *  
     * @type {string}
Shine-zwj's avatar
Shine-zwj committed
28
     * @memberof AppPanelItem
29 30
     */
    @Prop() public caption?: string;
Shine-zwj's avatar
Shine-zwj committed
31

32 33 34 35
    /**
     * 显示标题
     *  
     * @type {boolean}
Shine-zwj's avatar
Shine-zwj committed
36
     * @memberof AppPanelItem
37 38
     */
    @Prop() public showCaption?: boolean;
Shine-zwj's avatar
Shine-zwj committed
39

Shine-zwj's avatar
Shine-zwj committed
40 41 42 43 44 45 46 47
    /**
     * 标题样式
     *  
     * @type {boolean}
     * @memberof AppPanelItem
     */
    @Prop() public lableStyle?: string;

48 49 50 51
    /**
     * 点击按钮
     *
     * @param {*} $event
Shine-zwj's avatar
Shine-zwj committed
52
     * @memberof AppPanelItem
53 54 55
     */
    public onClick($event: any){
        this.$emit('onClick',$event);
Shine-zwj's avatar
Shine-zwj committed
56 57 58 59 60
    }

}
</script>
<style lang='less'>
Shine-zwj's avatar
Shine-zwj committed
61

Shine-zwj's avatar
Shine-zwj committed
62
</style>