mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
docs: Improve routing validate
example (#18728)
This commit is contained in:
parent
fcd63a0e18
commit
5eaeb4f83d
@ -132,7 +132,6 @@ If you have a more complex use case, then you can use anonymous route middleware
|
|||||||
<script setup>
|
<script setup>
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
validate: async (route) => {
|
validate: async (route) => {
|
||||||
const nuxtApp = useNuxtApp()
|
|
||||||
// Check if the id is made up of digits
|
// Check if the id is made up of digits
|
||||||
return /^\d+$/.test(route.params.id)
|
return /^\d+$/.test(route.params.id)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user