iview/src/components/carousel/carousel-item.vue

33 lines
727 B
Vue
Raw Normal View History

2017-01-16 02:45:11 -06:00
<template>
2017-01-16 04:28:34 -06:00
<div :class="prefixCls" v-bind:style="styles"><slot></slot></div>
2017-01-16 02:45:11 -06:00
</template>
<script>
const prefixCls = 'ivu-carousel-item';
export default {
2017-01-16 04:00:52 -06:00
componentName: 'carousel-item',
data () {
return {
prefixCls: prefixCls,
width: 0,
left: 0
};
},
computed: {
styles () {
return {
width: `${this.width}px`,
left: `${this.left}px`
}
}
},
compiled () {
2017-01-16 18:10:31 -06:00
this.$parent.slotChange();
},
beforeDestroy () {
this.$parent.slotChange();
}
2017-01-16 02:45:11 -06:00
};
</script>