Skip to content

Commit 28761c9

Browse files
aicestposva
authored andcommitted
Add TypeScript definition (linkExactActiveClass) to RouterOptions (#1471)
* Add TypeScript definition (`linkExactActiveClass`) to RouterOptions * Add test for RouterOptions (`linkExactActiveClass`)
1 parent 1b5caff commit 28761c9

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

test/e2e/specs/active-links.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ module.exports = {
4343
})
4444
exactActiveA.forEach(i => {
4545
browser.assert.cssClassPresent(`li:nth-child(${i}) a`, 'router-link-exact-active')
46+
.assert.cssClassPresent(`li:nth-child(${i}) a`, 'router-link-active')
4647
})
4748
exactActiveLI && exactActiveLI.forEach(i => {
4849
browser.assert.cssClassPresent(`li:nth-child(${i})`, 'router-link-exact-active')
50+
.assert.cssClassPresent(`li:nth-child(${i})`, 'router-link-active')
4951
})
5052
}
5153
}

types/router.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export interface RouterOptions {
4949
mode?: RouterMode;
5050
base?: string;
5151
linkActiveClass?: string;
52+
linkExactActiveClass?: string;
5253
parseQuery?: (query: string) => Object;
5354
stringifyQuery?: (query: Object) => string;
5455
scrollBehavior?: (

types/test/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const router = new VueRouter({
4141
mode: "history",
4242
base: "/",
4343
linkActiveClass: "active",
44+
linkExactActiveClass: "exact-active",
4445
scrollBehavior: (to, from, savedPosition) => {
4546
if (from.path === "/") {
4647
return { selector: "#app" };

0 commit comments

Comments
 (0)