【问题标题】:dynamique nuxt-link with strapi动态 nuxt-link 与strapi
【发布时间】:2021-01-01 05:10:21
【问题描述】:

我想我明白strapi + nuxt-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

请问我如何制作这个动态链接?

【问题讨论】:

    标签: javascript vue.js nuxt.js strapi


    【解决方案1】:

    这应该可以,标签不应该用``打开/关闭,但总是用双引号(“”)

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-16
      • 2019-07-21
      • 2023-02-06
      • 2019-12-12
      • 1970-01-01
      • 1970-01-01
      • 2021-09-10
      • 1970-01-01
      相关资源
      最近更新 更多