Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly pass $index in bootstrap data target v-for?

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 don't work

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

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

so how to properly use data-target + index ?

like image 243
Pds Ink Avatar asked Jul 13 '17 13:07

Pds Ink


1 Answers

found it!

:data-target="'#demo' + index" 
like image 198
Pds Ink Avatar answered Sep 28 '22 06:09

Pds Ink