0👍
You could try with:
<li v-for="(item, index) in searchResult.data.items">
<b-button :v-b-toggle="'collapse-' + index" variant="primary">{{ item.name }}</b-button>
<b-collapse :id="'collapse-' + index" class="mt-2">
<b-card>
<p class="card-text">{{ item.machine_code }}</p>
</b-card>
</b-collapse>
</li>
And update:
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.7.14/vue.min.js"></script>
to:
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-vue@2.21.2/dist/bootstrap-vue.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.7.14/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap-vue@2.21.2/dist/bootstrap-vue.js"></script>
- [Vuejs]-Vue 3 Props is not working on child components after binding it correctly. It returns undefined in child component
- [Vuejs]-Using V-model on a loop
Source:stackexchange.com