VUE轮播3D滑块高度

时间:2018-06-20 23:09:44

标签: javascript css vue.js height

我已经在网站上实现了VUE Carousel 3D Slider,但是找不到如何控制幻灯片上的高度。由于滑块不必要的太高,滑块下方有太多额外的空间。我试图设置父元素的高度:

#vue-slider {
    height: 100%;
}

但这没有帮助。

是否存在可以正确调整滑块高度的设置?

以下是此滑块在标题正下方运行的链接:

https://search.rosaviabilet.ru/flights/MOW1809MIL25091

虽然加载时有点延迟。

1 个答案:

答案 0 :(得分:1)

选中the source codes at GitHub

幻灯片高度绑定到计算所得的属性= slideHeight,然后您将看到

slideHeight () {
    const sw = parseInt(this.width, 10) + (parseInt(this.border, 10) * 2)
    const sh = parseInt(parseInt(this.height) + (this.border * 2), 10)
    const ar = this.calculateAspectRatio(sw, sh)
    return this.slideWidth / ar
}

this.widththis.borderthis.height是Carousel3d组件的道具。

最后,您需要调整宽度边框高度,以使幻灯片满足您的要求。

<carousel-3d :height="200" :width="100" :border="1"></carousel-3d>

相关问题