template code is
<div class="news_title" v-on:click="news_title" >
<ul>
<li class="news_active" type1="0"></li>
<li type1="1"></li>
<li type1="2"></li>
<li type1="3"></li>
<li type1="4"></li>
<li type1="5"></li>
<li type1="6"></li>
</ul>
</div>
the original jq code is:
$(".news_title").on("click","li",function(){
$(".news_title li").removeClass("news_active");
$(this).addClass("news_active");
var type=$(this).attr("type1");
});
could you tell me how to migrate this jq to vue to do click events? That is, click li to add the class name, brother remove the class name.
look at the online methods are to do for cycle, I would like to ask that there is no for loop to achieve it? The premise is not too complicated, crab