控制展示的class,然后获取order ,三目判断是否为升降序
<span v-show="isTwo" class="iconfont"
:class="{
'icon-Upxiangshang37': isAsc,
'icon-Downxiangxia': isDesc,}"></span>
changeOrder(flag) {
//flag形参代表,用户点击的时候 是综合1 还是价格2
let originFlay = this.searchParams.order.split(":")[0]
let originSort = this.searchParams.order.split(":")[1]
let newOrder = '';
if(originFlay == flag) {
newOrder = `${originFlay}:${originSort=="desc"?"asc":"desc" }`
}else{
newOrder = `${flag}:${originSort}`
}
//修改仓库中的order
this.searchParams.order = newOrder
//发送请求
this.goData()
},
标签:originFlay,searchParams,order,flag,let,newOrder,升降
From: https://www.cnblogs.com/xiaobo95/p/16635037.html