fix: useRouteMeta — fix RouteMeta import and callable type narrowing
This commit is contained in:
parent
517c33adde
commit
0f1bc2258a
1 changed files with 3 additions and 2 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
import { watch, onMounted, onUnmounted, type Ref, computed, unref } from 'vue'
|
import { watch, onMounted, onUnmounted, type Ref, computed, unref } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { useMeta } from './useMeta'
|
import { useMeta } from './useMeta'
|
||||||
import type { RouteMeta, RouteMetaValue, isMetaFunction } from '../types/route-meta.d'
|
import type { RouteMeta } from 'vue-router'
|
||||||
|
import type { RouteMetaValue } from '../types/route-meta'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composable for automatic meta tag management based on route configuration
|
* Composable for automatic meta tag management based on route configuration
|
||||||
|
|
@ -45,7 +46,7 @@ export function useRouteMeta() {
|
||||||
routeValue: typeof route
|
routeValue: typeof route
|
||||||
): T | undefined => {
|
): T | undefined => {
|
||||||
if (value === undefined) return undefined
|
if (value === undefined) return undefined
|
||||||
return typeof value === 'function' ? value(routeValue) : value
|
return typeof value === 'function' ? (value as Function)(routeValue) as T : value
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue