Skip to content

Commit 2a431da

Browse files
committed
v-link: improve active class regex
1 parent 1babc3e commit 2a431da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/directives/link.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default function (Vue) {
7272
}
7373
path = this.path = router._stringifyPath(path)
7474
this.activeRE = path && !this.exact
75-
? new RegExp('^' + path.replace(regexEscapeRE, '\\$&') + '(\\b|$)')
75+
? new RegExp('^' + path.replace(/\/$/, '').replace(regexEscapeRE, '\\$&') + '(\\/|$)')
7676
: null
7777
this.updateClasses(this.vm.$route.path)
7878
let isAbsolute = path.charAt(0) === '/'

0 commit comments

Comments
 (0)