the HTML code is as follows:
<view
v-show="!showLoading"
v-for="(item, index) in cards"
:key="index"
class="body-swiper"
@touchstart="touchstart"
@touchend="touchend($event, index, item.content.user.id)"
:style="{"z-index": (10 - index), top: item.top + "px"}"
:animation="item.animation">
<!-- -->
</view>
js code is as follows:
process the data returned by the ajax API:
for(let i=0;i<res.data.list.length;iPP) {
//
let item = {
content: res.data.list[i],
top: 18,
animation: {}
};
this.cards.push(item);
this.showLoading = false;
}
where res.data.list
returns 10 pieces of data at a time. When
enters the page for the first time, the card generated by the first 10 data loops of the request interface has touchstart
and touchend
events. The events on the card elements generated by the second 10 data loops after
have no effect
how should I change it?