From fe83212c06b39d4e37c405b3a75386e977d8ea3e Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Sun, 5 Jan 2020 22:45:34 +0800 Subject: [PATCH] fix(anchor): active link not correct --- packages/common/Anchor/src/BaseAnchor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/Anchor/src/BaseAnchor.vue b/packages/common/Anchor/src/BaseAnchor.vue index 9322642fd..8aff31a5c 100644 --- a/packages/common/Anchor/src/BaseAnchor.vue +++ b/packages/common/Anchor/src/BaseAnchor.vue @@ -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) {