wypratama
wypratama
NNuxt
Created by Gobbo on 8/23/2024 in #❓・help
Server doesnt have params when client does
I'm not sure if you can destructure route params like that you might need to call route.params.id if you want to get id. Also, you might need to watch id
const { data, error } = await useAsyncData<GuildGetResponse>('guild', () => $api(/api/guild/${id}/full), {watch: [route.params.id]});
const { data, error } = await useAsyncData<GuildGetResponse>('guild', () => $api(/api/guild/${id}/full), {watch: [route.params.id]});
5 replies
NNuxt
Created by eyJOdnJHb25uYSI6Imd2VXVwIn0= on 12/21/2023 in #❓・help
Organize folders?
As far as i know there is. profile.vue will be like parent wrapper for each of page under your profile folder and you just have to put <nuxt-page/> inside it to render each route.
6 replies
NNuxt
Created by oemer on 6/16/2023 in #❓・help
What is the suggested alternative to layout middlewares in Nuxt 3?
Can you define it in something like this?
<script lang="ts">
export default defineNuxtComponent({
middleware: ['auth']
})
</script>
<script lang="ts">
export default defineNuxtComponent({
middleware: ['auth']
})
</script>
it seems like the error is coming from importing the definePageMeta instead of defining the middleware it self
6 replies