0

I am facing a problem with Nuxt Link:

-First i make a v-for to build some html

   <li v-for="loja in lojas">
        <p>{{loja.nomeEmpresa}}</p>
        <p> {{loja.url}} </p>
        <NuxtLink :to="nextPage">Configurar</NuxtLink>
        <b-button>Visualizar</b-button>
   </li>

This object loja have {url,id}

So, my problem is: How to use NuxLink and pass this id to my next page?

My idea is something like, that does not work:

       <NuxtLink :to="nextPage?usuarioId=${{loja.id}}">Configurar</NuxtLink>

Anyone know how to?

Modena
  • 75
  • 8

1 Answers1

1

Use a template literal, like:

<NuxtLink :to="`nextPage?usuarioId=${loja.id}`">Configurar</NuxtLink>
Nick Dawes
  • 2,089
  • 1
  • 13
  • 20
  • Thanks!! I had given up about this. It works!! thanks so much! And the way i manage to get this data at the next page is using ``` this.$route.query.(the data that i just sent) ``` – Modena Mar 02 '21 at 16:42