File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import type { MaybeRef } from '@vueuse/core'
77import type { AnchorHTMLAttributes , ButtonHTMLAttributes } from 'vue'
88import type { RawLocation } from 'vue-router'
99
10- import Vue , { computed , reactive } from 'vue'
10+ import { computed , getCurrentInstance , reactive } from 'vue'
1111
1212type ButtonLinkProps = {
1313 // Required - general link props
@@ -65,7 +65,8 @@ export function useButtonLink(options: ButtonLinkProps) {
6565 // Resolve all MaybeRef-s values and maybe reactive object via unwrapping
6666 const props = reactive ( options )
6767
68- const hasVueRouterContext = Vue . prototype . $router !== undefined
68+ const instance = getCurrentInstance ( ) !
69+ const hasVueRouterContext = '$router' in instance . proxy . $root
6970
7071 /**
7172 * Tag name to be used
You can’t perform that action at this time.
0 commit comments