HTML Code:
< ul class= "list" >
<li class="item"
v-for="item of letters"
:key="item"
:ref="item"
@click="handleClick"
@touchstart="handleTouchStart"
@touchmove="handleTouchMove"
@touchend="handleTouchEnd"
>{{item}}</li>
</ul>
Logic Code:
handleTouchMove () {
console.log("handleTouchMove");
if (this.touchStatus) {
const startY = this.$refs.A[0].offsetTop
console.log(this.$refs.A); =====>,
console.log(startY);
}
},
data item: letters = [A recorder B recorder C recorder D recorder Ereco F recorder G recorder H repertory I recorder. Recorder Xpeng Ypeng Z]
I would like to ask you guys, when the ref here is used in the form of data binding, why does this.$refs.A print out an array?