definePageMeta

You will have autocompletion and typecheck for multiple properties in definePageMeta, both as a global import or from the @typed-router alias.

Like useRoute, it has a strict mode when you can assert the current page.

Properties enabled:

  • validate
  • redirect
  • key
Do yo Typescript limitations, return type for redirect may be buggy or not display anything. You can use the helpers util as a workaround Helpers doc

Exemple:

definePageMeta({
  validate(route) { // <- Typed
    return true
  }
})