Answers for "v-for accordion index"

0

v-for accordion index

<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="false">
            <ul>
              <li v-for="(item, index) in items" :key="index">

                  <div class="panel panel-default">
                    <div class="panel-heading" role="tab" id="headingOne">
                      <h4 class="panel-title">
                        {{ item.name }}
                        <div align="right">
                            <btn role="button" data-toggle="collapse" data-parent="#accordion" aria-expanded="false" :data-target="'#collapse-' + index" aria-controls="'#collapse-' + index">Select</btn>
                        </div>
                      </h4>
                    </div>

                    <div :id="'collapse-' + index" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
                      <div class="panel-body">
                        Drop down {{ index }}.
                      </div>
                    </div>

                  </div>
              </li>
            </ul>
        </div>
Posted by: Guest on November-04-2020

Browse Popular Code Answers by Language