简体   繁体   中英

dynamique nuxt-link with strapi

I think I understand that strapi + the nuxt-link tag allows you to make dynamically link to another view without methods.
I need a link for a vue with the id in parameter to received the good data on the url of strapi.
Actually i try that:

<li v-for="app in applications" :key="app.id">
  <nuxt-link to=`/applications/${app.id}`>
    {{ app.name }}
  </nuxt-link>
</li>

But my syntaxe is not correct, i have this error:

ERROR in ./components/TheSidebar.vue
  6:23  error    Parsing error: unexpected-character-in-unquoted-attribute-value  vue/no-parsing-error
  6:23  warning  Expected to be enclosed by double quotes                         vue/html-quotes
  6:24  error    Parsing error: unexpected-character-in-unquoted-attribute-value  vue/no-parsing-error
  6:38  error    Parsing error: unexpected-character-in-unquoted-attribute-value  vue/no-parsing-error

How can i make this dynamique link please?

This should work, tags should not be opened/closed with ``, but always with double quotes ("")

<li v-for="app in applications" :key="app.id">
   <nuxt-link :to="'/applications/' + app.id">
      {{ app.name }}
   </nuxt-link>
</li>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM