D
D
Dima Pautov2017-10-18 21:35:36
Vue.js
Dima Pautov, 2017-10-18 21:35:36

How to correctly substitute a variable in the to attribute in nuxt-link?

Good evening. Can you please tell me how to correctly substitute a variable in the to attribute?

<li v-for="city in cities">
  <nuxt-link to="/cities/{{city.id}}" :key="city.id">{{city.title}}</nuxt-link>
</li>

Gives an error. I did some googling and couldn't find an answer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artur Bordenyuk, 2017-10-18
@bootd

:to="`/cities/${city.id}`"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question