Skip to content

Commit

Permalink
Add TypeScript definition (linkExactActiveClass) to RouterOptions (#…
Browse files Browse the repository at this point in the history
…1471)

* Add TypeScript definition (`linkExactActiveClass`) to RouterOptions

* Add test for RouterOptions (`linkExactActiveClass`)
  • Loading branch information
aicest authored and posva committed May 28, 2017
1 parent 1b5caff commit 28761c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/e2e/specs/active-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ module.exports = {
})
exactActiveA.forEach(i => {
browser.assert.cssClassPresent(`li:nth-child(${i}) a`, 'router-link-exact-active')
.assert.cssClassPresent(`li:nth-child(${i}) a`, 'router-link-active')
})
exactActiveLI && exactActiveLI.forEach(i => {
browser.assert.cssClassPresent(`li:nth-child(${i})`, 'router-link-exact-active')
.assert.cssClassPresent(`li:nth-child(${i})`, 'router-link-active')
})
}
}
Expand Down
1 change: 1 addition & 0 deletions types/router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export interface RouterOptions {
mode?: RouterMode;
base?: string;
linkActiveClass?: string;
linkExactActiveClass?: string;
parseQuery?: (query: string) => Object;
stringifyQuery?: (query: Object) => string;
scrollBehavior?: (
Expand Down
1 change: 1 addition & 0 deletions types/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const router = new VueRouter({
mode: "history",
base: "/",
linkActiveClass: "active",
linkExactActiveClass: "exact-active",
scrollBehavior: (to, from, savedPosition) => {
if (from.path === "/") {
return { selector: "#app" };
Expand Down

0 comments on commit 28761c9

Please sign in to comment.