mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
fix(Carousel): pages calculation (#2345)
Co-authored-by: Edmund Chaplin <edmund.chaplin@zaros.co.uk>
This commit is contained in:
@@ -145,7 +145,13 @@ export default defineComponent({
|
||||
return 0
|
||||
}
|
||||
|
||||
return props.items.length - Math.round(carouselWidth.value / itemWidth.value) + 1
|
||||
const itemDivisions = Math.round(carouselWidth.value / itemWidth.value)
|
||||
|
||||
if (props.items.length <= itemDivisions) {
|
||||
return 0
|
||||
}
|
||||
|
||||
return props.items.length - itemDivisions + 1
|
||||
})
|
||||
|
||||
const isFirst = computed(() => currentPage.value <= 1)
|
||||
|
||||
Reference in New Issue
Block a user