vue 锚链接平滑滚动

getElementById传入对应的DOM id 即可

document.getElementById(id).scrollIntoView({ block: 'start', behavior: 'smooth' })

你可能感兴趣的:(vue 锚链接平滑滚动)