Modena
Modena

Reputation: 75

How to use NuxtLink and send data through pages

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?

Upvotes: 0

Views: 516

Answers (1)

Nick Dawes
Nick Dawes

Reputation: 2244

Use a template literal, like:

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

Upvotes: 1

Related Questions