<div class="showVideo">
<cube-slide ref="slide" :data="items" :allow-vertical="true" direction="vertical" :loop="false" :showDots="false">
<cube-slide-item v-for="(item, index) in items" :key="index">
<img :src="item.image">
</cube-slide-item>
</cube-slide>
</div>
<script>
export default {
data() {
return {
items: [
{
image: require('./banner.jpg')
},
{
image: require('./banner2.jpg')
}
]
}
}
</script>
<style lang='stylus' scoped>
.showVideo
position: absolute
top: 0
left: 0
right: 0
bottom: 0
overflow: hidden
.showVideo /deep/ .cube-slide-item > img
width: 100%
height: 100%
</style>
可以看出cube-slide 上一级要用div包裹,然后设置div高度,才能正常显示