vue 锚链接平滑滚动
2020-08-28 本文已影响0人
刘员外__
getElementById
传入对应的DOM id 即可
document.getElementById(id).scrollIntoView({ block: 'start', behavior: 'smooth' })
getElementById
传入对应的DOM id 即可
document.getElementById(id).scrollIntoView({ block: 'start', behavior: 'smooth' })