当前位置:网站首页>el-table中el-table-column下的操作切换class样式
el-table中el-table-column下的操作切换class样式
2022-07-30 12:51:00 【周家大小姐.】
需求:用操作按钮太多;设计这边想如果按钮大于3个就把它放在更多中;如果点击更多;就向左出现;再点击就隐藏,如果当前row为展开又点其它row的更多 ;就把这个展开的关闭箭头恢复成向左显示

代码:
el-table结合el-popover弹出框
html:
<el-popover
placement="left-end"
width="200"
trigger="click"
popper-class="xk-flex-popover"
:offset="-15"
:visible-arrow="false"
@show="handleShow(scope.$index)"
@hide="handleHide(scope.$index)"
>
<!-- <transition name="slide-fade"> v-if="scope.$index == isRotateIndex"-->
<div>
<el-button
type="text"
size="mini"
@click="handleEditReport(scope.row)"
>报告日志</el-button
>
<el-button
type="text"
size="mini"
@click="handleEditReport(scope.row)"
>检测详情</el-button
>
<el-button
type="text"
size="mini"
@click="handleEditReport(scope.row)"
>发起复测</el-button
>
</div>
<!-- </transition> -->
<el-button slot="reference" type="text">
<i
:class="[
'el-icon-arrow-left',
isRotateIndex === scope.$index && isRotateShow
? 'xk-rotate-170'
: 'xk-rotate-0'
]"
></i>
更多</el-button
>
</el-popover>css:
.xk-rotate-170 {
transform: rotate(-180deg);
transition: all .3s;
}
.xk-rotate-0 {
// animation: rotate0 0.3s;
transform: rotate(0deg);
transition: all .3s;
}js:
data () {
return {
isRotateShow: false,
isRotateIndex: null,
preRotateIndex: null
}
},
methods: {
// 处理table中操作栏下的更多旋转方法
// 更多关闭
handleHide (i) {
if (this.preRotateIndex !== i) {
// 如果上一个index和当前index不相等就让上一个关闭当前这个展开
this.isRotateShow = true
this.isRotateIndex = this.preRotateIndex
return
}
// 如果上一个和当前index不相等就还原
this.isRotateIndex = null
this.isRotateShow = false
},
// 更多展开
handleShow (i) {
this.isRotateShow = true
this.isRotateIndex = i
this.preRotateIndex = i
}
}
效果如下:

边栏推荐
- dolphinscheduler simple task definition and complex cross-node parameter transfer
- C语言学习练习题:汉诺塔(函数与递归)
- I built another wheel: GrpcGateway
- EasyNVR更新版本至(V5.3.0)后页面不显示通道配置该如何解决?
- R语言ggpubr包的ggboxplot函数可视化分组箱图、自定义移除可视化图像的特定对象(移除可视化图像轴坐标轴的刻度线标签文本、both x and y axis ticks labels)
- 缓存
- How to display an Excel table in the body of an email?
- 数字化时代,寻求企业财务转型路径的最优解
- 【微信小程序】一文带你搞懂小程序的页面配置和网络数据请求
- 基于卷积神经网络与双向长短时融合的锂离子电池剩余使用寿命预测
猜你喜欢
随机推荐
腰部外骨骼机器人线性自抗扰控制器参数优化
句柄与指针的简单理解
元宇宙的六大支撑技术
CMake library search function does not search LD_LIBRARY_PATH
Win11打不开exe应用程序怎么办?Win11无法打开exe程序解决方法
【Kaggle:UW-Madison GI Tract Image Segmentation】肠胃分割比赛:赛后复盘+数据再理解
EasyNVS cloud management platform function reconstruction: support for adding users, modifying information, etc.
【河北工业大学】考研初试复试资料分享
datax enables hana support and dolphinscheduler enables datax tasks
666666
无人艇轨迹跟踪的预设性能抗扰控制研究
什么是驱动程序签名,驱动程序如何获取数字签名?
58. 最后一个单词的长度
Greenplum 6.0有哪些不可错过的硬核升级与应用?
我又造了个轮子:GrpcGateway
基于柔性人机接口的人机协调运动控制方法
并行化快速排序设想
关于香港高防IP需要关注的几个问题
RTSP/Onvif协议视频平台EasyNVR服务一键升级功能的使用教程
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(xlab、ylab、改变可视化图像的坐标轴标签内容)









