vue實現跳錨點

1.元素加上id,下面是循環中動態添加 :id="'product' + index" 也可以用vue ref實現 2.點擊 // 跳轉到對應錨點 document.getElementById('product' + index).scrollIntoView(true)   scrollIntoView(true) 跳到元素頂部 scrollIntoView(flase) 跳到元素底部   3
相關文章
相關標籤/搜索