Skip to content

Commit 03475fe

Browse files
committed
fix: 修复指示器高亮显示异常的问题
1 parent 7288cce commit 03475fe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

carousel/src/carousel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default defineComponent({
9090
{slots.indicator ? (
9191
slots.indicator({
9292
count,
93-
pageIndex: pageIndex.value,
93+
pageIndex: formattedPageIndex.value,
9494
setPageIndex
9595
})
9696
) : (

docs/features/leetcode-card/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<template #pagination></template>
1414
<template #indicator="page">
1515
<DCarouselIndicator>
16-
<div v-for="item of Array.from(new Array(3).keys())" :class="['leetcode-indicator-item', page.pageIndex === item && 'active']" @click="page.setPageIndex(item)"></div>
16+
<div v-for="item of Array.from(new Array(3).keys())" :class="['leetcode-indicator-item', page.pageIndex === item+1 && 'active']" @click="page.setPageIndex(item+1)"></div>
1717
</DCarouselIndicator>
1818
</template>
1919
</DCarousel>
@@ -65,7 +65,7 @@
6565
<template #pagination></template>
6666
<template #indicator="page">
6767
<DCarouselIndicator>
68-
<div v-for="item of Array.from(new Array(3).keys())" :class="['leetcode-indicator-item', page.pageIndex === item && 'active']" @click="page.setPageIndex(item)"></div>
68+
<div v-for="item of Array.from(new Array(3).keys())" :class="['leetcode-indicator-item', page.pageIndex === item+1 && 'active']" @click="page.setPageIndex(item+1)"></div>
6969
</DCarouselIndicator>
7070
</template>
7171
</DCarousel>

0 commit comments

Comments
 (0)