diff --git a/e2e/cypress.config.ts b/e2e/cypress.config.ts index 64bc8add21..7b3a888176 100644 --- a/e2e/cypress.config.ts +++ b/e2e/cypress.config.ts @@ -74,6 +74,7 @@ export default defineConfig({ }, }) }, + experimentalRunAllSpecs: true, }, env: { E2E_BASE: process.env.E2E_BASE ?? '/', diff --git a/packages/client/src/components/RouteLink.ts b/packages/client/src/components/RouteLink.ts index 6b7c0f0fbf..e4b9fb9ea2 100644 --- a/packages/client/src/components/RouteLink.ts +++ b/packages/client/src/components/RouteLink.ts @@ -23,6 +23,29 @@ const guardEvent = (event: MouseEvent): boolean | void => { return true } +export interface RouteLinkProps { + /** + * Whether the link is active to have an active class + * + * Notice that the active status is not automatically determined according to the current route. + * + * @default false + */ + active?: boolean + + /** + * The class to add when the link is active + * + * @default 'route-link-active' + */ + activeClass?: string + + /** + * The route path to link to + */ + to: string +} + /** * Component to render a link to another route. * @@ -80,7 +103,7 @@ export const RouteLink = defineComponent({ href: path.value, onClick: (event: MouseEvent = {} as MouseEvent) => { if (guardEvent(event)) { - router.push(path.value).catch() + router.push(props.to).catch() } }, },