鄂州网站推广优化技巧,sem优化技巧,怎么在网站上做外链,爱站工具包的主要功能1、需求
电商首页需求#xff0c;需要做个单选框#xff0c;然后点击选中切换图标方向及更换价格升倒序#xff0c;如下图#xff1a; 从官网文档看#xff0c;单选框支持change event#xff0c;使用click加载按钮处不会触发选中 但是使用 click.native 事件不做处理…1、需求
电商首页需求需要做个单选框然后点击选中切换图标方向及更换价格升倒序如下图 从官网文档看单选框支持change event使用click加载按钮处不会触发选中 但是使用 click.native 事件不做处理的话会发送多次请求 解决方案如下
el-radio-group v-modelbuttonRightRadio idbuttonRightRadioel-radio-button labeldefault click.nativesortBy(default,$event)默认/el-radio-buttonel-radio-button labelsales click.nativesortBy(sales,$event)销量i :class{el-icon-top: sortType sales sortDirection desc, el-icon-bottom: sortType sales sortDirection asc}/i/el-radio-buttonel-radio-button labelprice click.nativesortBy(price,$event)价格i :class{el-icon-top: sortType price sortDirection desc, el-icon-bottom: sortType price sortDirection asc}/i/el-radio-button/el-radio-groupsortBy(type, event) {//此处解决发送多次请求if (event.target.tagName ! INPUT) {return;}if (type default) {this.sortType ;this.sortDirection ;this.load();return;}if (this.sortType type) {// 如果当前已经是该排序方式则切换排序方向this.sortDirection this.sortDirection desc ? asc : desc;this.load()} else {// 如果当前不是该排序方式则设置为该排序方式并将排序方向设为降序this.sortType type;this.sortDirection desc;this.load()}},