operation.vue 977 Bytes
<template>
    <div :class="prefixCls + '-operation'">
        <i-button type="primary" size="small" :disabled="!rightActive" @click="moveToLeft">
            <Icon type="ios-arrow-left"></Icon> {{ operations[0] }}
        </i-button>
        <i-button type="primary" size="small" :disabled="!leftActive" @click="moveToRight">
            {{ operations[1] }} <Icon type="ios-arrow-right"></Icon>
        </i-button>
    </div>
</template>
<script>
    import iButton from '../button/button.vue';
    import Icon from '../icon/icon.vue';

    export default {
        components: { iButton, Icon },
        props: {
            prefixCls: String,
            operations: Array,
            leftActive: Boolean,
            rightActive: Boolean
        },
        methods: {
            moveToLeft () {
                this.$parent.moveTo('left');
            },
            moveToRight () {
                this.$parent.moveTo('right');
            }
        }
    };
</script>