|
@@ -34,14 +34,14 @@
|
|
|
<ul
|
|
|
class="el-carousel__indicators"
|
|
|
v-if="indicatorPosition !== 'none'"
|
|
|
- :class="{ 'el-carousel__indicators--outside': indicatorPosition === 'outside' || type === 'card' }">
|
|
|
+ :class="{ 'el-carousel__indicators--labels': hasLabel, 'el-carousel__indicators--outside': indicatorPosition === 'outside' || type === 'card' }">
|
|
|
<li
|
|
|
v-for="(item, index) in items"
|
|
|
class="el-carousel__indicator"
|
|
|
:class="{ 'is-active': index === activeIndex }"
|
|
|
@mouseenter="throttledIndicatorHover(index)"
|
|
|
@click.stop="handleIndicatorClick(index)">
|
|
|
- <button class="el-carousel__button"></button>
|
|
|
+ <button class="el-carousel__button"><span v-if="hasLabel">{{ item.label }}</span></button>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
@@ -95,6 +95,12 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
|
|
|
+ computed: {
|
|
|
+ hasLabel() {
|
|
|
+ return this.items.some(item => item.label.toString().length > 0);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
watch: {
|
|
|
items(val) {
|
|
|
if (val.length > 0) this.setActiveItem(0);
|