File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 1- import { usePage } from '@inertiajs/vue3' ;
21import type { InertiaLinkProps } from '@inertiajs/vue3' ;
2+ import { usePage } from '@inertiajs/vue3' ;
33import { computed , readonly } from 'vue' ;
44
5- const page = usePage ( )
6- const currentUrlReactive = computed ( ( ) => new URL ( page . url , window ?. location . origin ) . pathname ) ;
5+ const page = usePage ( ) ;
6+ const currentUrlReactive = computed (
7+ ( ) => new URL ( page . url , window ?. location . origin ) . pathname ,
8+ ) ;
79
810function toUrl ( href : NonNullable < InertiaLinkProps [ 'href' ] > ) {
911 return typeof href === 'string' ? href : href ?. url ;
1012}
1113
12- export function useActiveUrl ( ) {
13- function urlIsActive (
14+ export function useActiveUrl ( ) {
15+ function urlIsActive (
1416 urlToCheck : NonNullable < InertiaLinkProps [ 'href' ] > ,
1517 currentUrl ?: string ,
1618 ) {
@@ -21,6 +23,6 @@ export function useActiveUrl(){
2123 return {
2224 currentUrl : readonly ( currentUrlReactive ) ,
2325 urlIsActive,
24- toUrl
25- }
26- }
26+ toUrl,
27+ } ;
28+ }
You can’t perform that action at this time.
0 commit comments