锚点定位且不改变url
html
事件触发
<li v-for="(item,index) in couponsList.swaps" :key="index" @click="toTegional(index)">{{regionalList[index]}}</li>
1
2
锚点埋藏
<div v-for="(item,index) in couponsList.swaps" :key="index" :id="'price'+index">
1
2
JavaScript
toTegional(index) {
let id = '#price' + index;
document.querySelector(id).scrollIntoView(true);
},