v-on:click='handle(index)' The click event implements the switching function and passes parameters
v-bind:class='currentIndex==index? "active":""' Use the ternary operator to judge whether the currentIndex of the life is equal to index If it is equal, add an active style to the li tag; if it is not equal, it will be empty
<divid="app"><divclass="tab"><ul><liv-on:click='handle(index)'v-bind:class='currentIndex==index?"active":""'v-bind:key='item.id'v-for='(item,index) in list'>{
{item.title}}</li></ul><divv-for='(item,index) in list'v-bind:class='currentIndex==index?"current":""'><img:key='item.id':src="item.path"alt=""></div></div></div>