2021年4月6日星期二

In vue, how do i display attribute of tag? (how does v-for work with html?)

<ul>      <span class="tabs"           :class="{ activeTab: selectedTab === tab }"            v-for="(tab, index) in tabs"            @click="selectedTab = tab"            :key="tab">            . </span>  </ul>    .....     data() {        return {          tabs: ['Reviews', 'Make a Review'],          selectedTab: 'Reviews'                  }      }    })    

I want to know value of "tab" before click 'Reviews' or 'Make a Review'. so how do I display "tab"?

https://stackoverflow.com/questions/66950454/in-vue-how-do-i-display-attribute-of-tag-how-does-v-for-work-with-html April 05, 2021 at 04:54PM

没有评论:

发表评论