[Vuejs]-Vue b-button doesn't take

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>

Leave a comment