new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Nuxt · API · all subjects

definex functions

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

key option in definePageMeta

The key option can be defined within the definePageMeta compiler macro. It can be a string value like 'index' or a method that receives the route and returns a string, such as route => route.fullPath. This replaces the key property from Nuxt 2 component options.

scrollToTop option in definePageMeta

The scrollToTop option can be specified within the definePageMeta compiler macro with a boolean value like false. This replaces the scrollToTop property from Nuxt 2 component options. Custom scroll behavior of vue-router can be overwritten in ~/router.options.ts.

validate hook in definePageMeta signature and behavior

The validate hook in Nuxt 3 accepts a single argument: the route object. It can return a boolean value; if false is returned and another route match cannot be found, a 404 will be rendered. The validate function can also directly return an object with status and statusText properties to respond immediately with an error without checking other matches.

definePageMeta with key option example

Example of using definePageMeta with key option in Nuxt 3: ```vue <script setup> definePageMeta({ key: 'index' // or a method // key: route => route.fullPath }) </script> ```

definePageMeta with scrollToTop option example

Example of using definePageMeta with scrollToTop option in Nuxt 3: ```vue <script setup> definePageMeta({ scrollToTop: false }) </script> ```

definePageMeta with validate hook example

Example of using definePageMeta with validate hook in Nuxt 3: ```vue <script setup> definePageMeta({ validate: async (route) => { const nuxtApp = useNuxtApp() return /^\d+$/.test(route.params.id) } }) </script> ``` The validate hook receives the route object as its only argument.

Give your agent this brain