由于采用position: fixed;,导致锚点链接,链接到的位置被固定导航条遮挡
解决:
去除掉导航条宽度,使其链接到前130px的位置
this.$el.querySelector(`#section${index}`)
.scrollIntoView({
behavior: 'smooth',
block: 'start'
})
let top = document.getElementById(`section${index}`).offsetTop
window.scrollTo({top:top-130,behavior:'smooth'});