我的路由器链接有问题:到。我的路由器链接无法呈现我的模板。这是我的网络路由,routes.js和 VUE </跨度> 模板。我想把img产品的clik用于:‘product / 1234’,但是很重要, 组件:ProductIndex }
和 Vue公司 </跨度> 模板:
&lt; div class =“product”v-for =“产品中的产品”&gt; &lt; router-link class =“product-image”:to =“{path:‘product’,params:{id锟
您正在链接到路径,尝试将其更改为您的路线名称:
<router-link class="product-image" :to="{ name: 'ProductIndex', params: { id: product.id}}"> <img src="/static/shop/products/shoe-example.png"/> </router-link>