function scrollInto(name, pos = 'center') {
nextTick(() => {
document.getElementById(name).scrollIntoView({
behavior: 'smooth', // 平滑过渡
block: pos // 上边框与视窗顶部平齐
})
})
}
:target //锚点定位
function scrollInto(name, pos = 'center') {
nextTick(() => {
document.getElementById(name).scrollIntoView({
behavior: 'smooth', // 平滑过渡
block: pos // 上边框与视窗顶部平齐
})
})
}
:target //锚点定位