79124760

Date: 2024-10-25 07:57:33
Score: 1
Natty:
Report link

To do that you need to create the next folder structure

-| pages/
---| profile/
-----| index.vue
-----| [usernane].vue

and then in your component you can get the username with

<script setup lang="ts">
const route = useRoute()
console.log(route.params.username)
</script>

Reference: https://nuxt.com/docs/getting-started/routing

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Jose Antonio GS