0

I'm using NUXT3 When the URL is localhost:3000/Eventik/events and I click on a link

 <NuxtLink class="list-group-item" :to="/events/edit/${event.eventId}">{{ $t('edit') }}</NuxtLink> 

inside the page,

it works correctly and goes to the address localhost:3000/Eventik/events/edit/1.

However, when the URL is localhost:3000/Eventik/events/ and I click on the same link, it takes me to the wrong URL localhost:3000/Eventik/events/events/edit/1.

I tried

 <NuxtLink class="list-group-item" :to="edit/${event.eventId}">{{ $t('edit') }}</NuxtLink> 

when the URL is localhost:3000/Eventik/events the result -> localhost:3000/Eventik/edit/1 and it's not correct.

and when the URL islocalhost:3000/Eventik/events or localhost:3000/Eventik/events/ with

 <NuxtLink class="list-group-item" :to="/edit/${event.eventId}">{{ $t('edit') }}</NuxtLink> 

-> localhost:3000/edit/1

AwadhJY
  • 1
  • 2
  • If possible, provide us a production link. In your case, it is harder for us to debug your issue. You can use stackblitz or codesanbox – ReaganM Aug 01 '23 at 22:07
  • @ReaganM I solve it by $route.path but I don't think if it's a good practices {{ $t('edit') }} – AwadhJY Aug 02 '23 at 09:55

0 Answers0