第一种:
<template>
<div>
<!-- 排序 -->
<div class="list-sort">
<div>综合</div>
<div style="display: flex;align-items: center;">
<div @click="onSort">价格</div>
<div>
<div :class="{'active':isSort==1}" class="iconfont icon-jiantou"></div>
<div :class="{'active':isSort==2}" class="iconfont icon-jiantouxia"></div>
</div>
</div>
</div>
</div>
</template>
<script>
export default{
data(){
return{
list:[],
isSort:0 //1为升序,2为降序
}
},
methods:{
onSort(){