vue实现跳锚点

1.元素加上id,下面是循环中动态添加 :id="'product' + index" 也可以用vue ref实现 2.点击 // 跳转到对应锚点 document.getElementById('product' + index).scrollIntoView(true)   scrollIntoView(true) 跳到元素顶部 scrollIntoView(flase) 跳到元素底部   3
相关文章
相关标签/搜索