Skip to content

Commit 0b6ff09

Browse files
committed
fix named routes active matching (fix #622)
1 parent 87b8492 commit 0b6ff09

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/link.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ export default {
2828
const href = base ? cleanPath(base + fullPath) : fullPath
2929
const classes = {}
3030
const activeClass = this.activeClass || router.options.linkActiveClass || 'router-link-active'
31+
const compareTarget = to.path ? to : resolved
3132
classes[activeClass] = this.exact
32-
? isSameRoute(current, to)
33-
: isIncludedRoute(current, to)
33+
? isSameRoute(current, compareTarget)
34+
: isIncludedRoute(current, compareTarget)
3435

3536
const data = {
3637
class: classes,

0 commit comments

Comments
 (0)