Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(link): expose useLink on RouterLink as internal (#1002)
Co-authored-by: Eduardo San Martin Morote <posva13@gmail.com>
  • Loading branch information
KaelWD and posva committed Jun 18, 2021
1 parent e742315 commit 57b1468
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/RouterLink.ts
Expand Up @@ -149,6 +149,8 @@ export const RouterLinkImpl = /*#__PURE__*/ defineComponent({
},
},

useLink,

setup(props, { slots }) {
const link = reactive(useLink(props))
const { options } = inject(routerKey)!
Expand Down Expand Up @@ -218,13 +220,20 @@ export const RouterLinkImpl = /*#__PURE__*/ defineComponent({
/**
* Component to render a link that triggers a navigation on click.
*/
export const RouterLink = RouterLinkImpl as {
export const RouterLink = RouterLinkImpl as unknown as {
new (): {
$props: AllowedComponentProps &
ComponentCustomProps &
VNodeProps &
RouterLinkProps
}

/**
* Access to `useLink()` without depending on using vue-router
*
* @internal
*/
useLink: typeof useLink
}

function guardEvent(e: MouseEvent) {
Expand Down

0 comments on commit 57b1468

Please sign in to comment.