Search code examples
twitter-bootstrapvue.jsv-for

How to properly pass $index in Bootstrap data target?


I created dynamic ids using v-for index, the problem is when I'm trying to use Bootstrap's data-target to link the div

This doesn't work:

<button data-toggle="collapse" data-target="'#demo'+{{$index}}">EXPAND</button> 

<div v-bind:id="['demo'+index]" class="collapse">
    {{service.sotto[index]}}
</div>

So how to properly use data-target + index?


Solution

  • found it!

    :data-target="'#demo' + index"