[英]Vue.js, bootstrap-vue syntax of concatenating string and variable
I'm having a syntax issue with '="collapse-{{ product.id }}"' both in the b-button & b-collapse.我在 b-button 和 b-collapse 中都遇到了 '="collapse-{{ product.id }}"' 的语法问题。 How should this be formed?
这应该如何形成? Just trying to create a unique ID that ties the button to the collapse tag.
只是试图创建一个唯一的 ID,将按钮与折叠标签联系起来。
<b-list-group header="List Product 1">
<b-list-group-item
:variant="product.inventoryStatus? 'success': 'danger'"
style="min-width: 30%; max-width: 30%"
:border-variant="product.inventoryStatus ? 'success' : 'danger'"
align="center"
v-for="product in productList" :key="product.id">
<b-button v-b-toggle="collapse-{{ product.id }}" class="m-1">{{ product.name }}</b-button>
<b-collapse id="collapse-{{ product.id }}">
Price: {{ product.price }}<br>
Brand: {{ product.brand }}<br>
<p :bg-variant="product.inventoryStatus? 'success': 'danger'">{{product.inventoryStatus ? 'IN STOCK': 'OUT OF STOCK'}}</p>
<table>
<tr>
<td>
<b-button variant="danger" @click="deleteProduct(product.id)">
<i class="fa fa-trash"></i></b-button>
</td>
<td>
<UpdateProduct :product="product"/>
</td>
</tr>
</table>
</b-collapse>
</b-list-group-item>
</b-list-group>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.