Skip to content

Commit 2a5f75e

Browse files
committed
Merge branch 'route-relative' into markdown-links
2 parents 07a2913 + 6ecb166 commit 2a5f75e

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

e2e/cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export default defineConfig({
7474
},
7575
})
7676
},
77+
experimentalRunAllSpecs: true,
7778
},
7879
env: {
7980
E2E_BASE: process.env.E2E_BASE ?? '/',

packages/client/src/components/RouteLink.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,29 @@ const guardEvent = (event: MouseEvent): boolean | void => {
2323
return true
2424
}
2525

26+
export interface RouteLinkProps {
27+
/**
28+
* Whether the link is active to have an active class
29+
*
30+
* Notice that the active status is not automatically determined according to the current route.
31+
*
32+
* @default false
33+
*/
34+
active?: boolean
35+
36+
/**
37+
* The class to add when the link is active
38+
*
39+
* @default 'route-link-active'
40+
*/
41+
activeClass?: string
42+
43+
/**
44+
* The route path to link to
45+
*/
46+
to: string
47+
}
48+
2649
/**
2750
* Component to render a link to another route.
2851
*
@@ -80,7 +103,7 @@ export const RouteLink = defineComponent({
80103
href: path.value,
81104
onClick: (event: MouseEvent = {} as MouseEvent) => {
82105
if (guardEvent(event)) {
83-
router.push(path.value).catch()
106+
router.push(props.to).catch()
84107
}
85108
},
86109
},

0 commit comments

Comments
 (0)