Fixes #1201 - Add conditional rendering to Carousel indicators

When totalIndicators is below 0 (when the value prop is an empty array) and numScroll !== numVisible, a RangeError is thrown.
pull/1196/head^2
Yannis Thomopoulos 2021-05-15 12:59:28 +03:00 committed by GitHub
parent 60547bc237
commit b3dece37ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@
<span :class="['p-carousel-prev-icon pi', {'pi-chevron-right': !isVertical(),'pi-chevron-down': isVertical()}]"></span>
</button>
</div>
<ul :class="indicatorsContentClasses">
<ul v-if="totalIndicators >= 0" :class="indicatorsContentClasses">
<li v-for="(indicator, i) of totalIndicators" :key="'p-carousel-indicator-' + i.toString()" :class="['p-carousel-indicator', {'p-highlight': d_page === i}]">
<button class="p-link" @click="onIndicatorClick($event, i)" type="button" />
</li>