Vue 点击对应的元素改变class
<div class="filter stopPop" id="filter"><dl class="filter-price"><dt>Price:</dt><dd v-on:click.stop="p
·
<div class="filter stopPop" id="filter">
<dl class="filter-price">
<dt>Price:</dt>
<dd v-on:click.stop="priceChecked = 'all'">
<a href="javascript:void(0)" v-bind:class="{'cur': priceChecked === 'all'}">All</a>
</dd>
<dd v-for="(price, index) in priceFilter" v-on:click.stop="priceChecked = index">
<a href="javascript:void(0)"
v-bind:class="{'cur': priceChecked === index}"
>{{price.startPrice}} - {{price.endPrice}}</a>
</dd>
</dl>
</div>
更多推荐
已为社区贡献8条内容
所有评论(0)