vue实现a标签的锚点跳转功能
<li @click="anchorJump">
<span class="anchorEle">jump</span>
</li>
anchorJump() {
const anchorEle = document.querySelector("#anchor");
if (!!anchorEle ) {
anchorEle .scrollIntoView(true);
}
}
document.querySelector("要返回地方的id").scrollIntoView(true);