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`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2017-01-16 18:02:51 -06:00
|
|
|
compiled () {
|
2017-01-16 18:10:31 -06:00
|
|
|
this.$parent.slotChange();
|
|
|
|
},
|
|
|
|
beforeDestroy () {
|
|
|
|
this.$parent.slotChange();
|
2017-01-16 18:02:51 -06:00
|
|
|
}
|
2017-01-16 02:45:11 -06:00
|
|
|
};
|
|
|
|
</script>
|