Swiper 页面指示器
Swiper 页面指示器
Swiper 指示器466×466px
<stack>
<swiper ::index="index">
<p for="i in panels">Panel {{i + 1}}</p>
</swiper>
<div class="indicator">
<image for="x in indicator" :src="x" />
</div>
</stack>
export default {
data: {
panels: 5,
index: 2
},
computed: {
indicator() {
let result = []
for (let i = 0; i < this.panels; i++) {
let suffix = i == this.index ? '1' : '0'
result.push(`/assets/images/ind-${suffix}.png`)
}
return result
}
}
}
swiper > p {
background-color: #888;
margin: 32px;
border-radius: 32px;
text-align: center;
}
.indicator {
display: flex;
justify-content: center;
align-items: flex-end;
}
.indicator > * {
margin: 0 4px 56px 4px;
}