I was trying to combine functionality upon clicking the button in VueJS.(我试图在单击VueJS中的按钮时合并功能。)
<button class="btn" type="button" @click="doingsomething">Btn1</button>
<button class="btn" type="button" @click="activeBtn = 'btn1'" :class="{active: activeBtn === 'btn1' }">Btn1</button>
尝试这个;
<button class="btn" type="button" @click="doingsomething();activeBtn='btn1'" :class="{active: activeBtn === 'btn1' }">Btn1</button>
1.4m articles
1.4m replys
5 comments
57.0k users