(meta: PageMeta)
| 75 | |
| 76 | // eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 77 | export const definePageMeta = (meta: PageMeta): void => { |
| 78 | if (import.meta.dev) { |
| 79 | const component = getCurrentInstance()?.type |
| 80 | try { |
| 81 | const isRouteComponent = component && useRoute().matched.some(p => Object.values(p.components || {}).includes(component)) |
| 82 | const isRenderingServerPage = import.meta.server && useNuxtApp().ssrContext?.islandContext |
| 83 | if (isRouteComponent || isRenderingServerPage || ((component as any)?.__clientOnlyPage)) { |
| 84 | // don't warn if it's being used in a route component (or server page) |
| 85 | return |
| 86 | } |
| 87 | } catch { |
| 88 | // ignore any errors with accessing current instance or route |
| 89 | } |
| 90 | warnRuntimeUsage('definePageMeta') |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * You can define route rules for the current page. Matching route rules will be created, based on the page's _path_. |
no test coverage detected
searching dependent graphs…