带 strapi 的动态 nuxt-link
dynamique nuxt-link with strapi
我想我明白 strapi + nuxt-link 标签允许你动态地 link 到另一个视图而无需方法。
我需要一个 link 用于带有参数 id 的 vue,以便在 strapi 的 url 上接收到良好的数据。
其实我试过:
<li v-for="app in applications" :key="app.id">
<nuxt-link to=`/applications/${app.id}`>
{{ app.name }}
</nuxt-link>
</li>
但是我的语法不正确,我有这个错误:
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
请问我怎样才能使这个动态link?
这应该有效,标签不应 opened/closed 和 ``,而应始终使用双引号 ("")
<li v-for="app in applications" :key="app.id">
<nuxt-link :to="'/applications/' + app.id">
{{ app.name }}
</nuxt-link>
</li>
我想我明白 strapi + nuxt-link 标签允许你动态地 link 到另一个视图而无需方法。
我需要一个 link 用于带有参数 id 的 vue,以便在 strapi 的 url 上接收到良好的数据。
其实我试过:
<li v-for="app in applications" :key="app.id">
<nuxt-link to=`/applications/${app.id}`>
{{ app.name }}
</nuxt-link>
</li>
但是我的语法不正确,我有这个错误:
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
请问我怎样才能使这个动态link?
这应该有效,标签不应 opened/closed 和 ``,而应始终使用双引号 ("")
<li v-for="app in applications" :key="app.id">
<nuxt-link :to="'/applications/' + app.id">
{{ app.name }}
</nuxt-link>
</li>