docs: Improve routing validate example (#18728)

This commit is contained in:
aimer-fan 2023-02-03 17:25:47 +08:00 committed by GitHub
parent fcd63a0e18
commit 5eaeb4f83d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
} }