fix(anchor): active link not correct

This commit is contained in:
07akioni 2020-01-05 22:45:34 +08:00
parent b26f98da4e
commit fe83212c06

View File

@ -173,7 +173,7 @@ export default {
})
const currentActiveHref = this.activeHref
const activeLink = links.reduce((prevLink, link, index) => {
if (index === links.length - 1 && link.top + link.height < 0) {
if (link.top + link.height < 0) {
return prevLink
}
if (link.top <= this.bound) {