【sgMoreMenu】自定义组件:“更多操作⌵”上下文关联按钮)下拉菜单。可用于表格操作列显示不下折叠的更多操作下拉框。
sgMoreMenutemplate !-- 更多操作 -- el-dropdown v-ifshowMoreBtn :class$options.name stylemargin-left: 10px :show-timeout0 :split-buttonfalse :placementbottom-end command (command) { let index dropdownItems.findIndex((v) v.label command); let item dropdownItems[index]; item.clickEvent item.clickEvent({ item, index, scope: scope }); } slot v-if$slots.default / template v-else i classel-icon-more v-ifbuttonType icon :titletext / span stylecursor: default v-else {{ text }}i classel-icon-arrow-down //span /template el-dropdown-menu slotdropdown :styledropdownMenuStyle :class${$options.name}-dropdown-menu el-dropdown-item v-for(d, i) in dropdownItems v-if$g.item.show({ item: d, index: i, scope: scope }) :keyi :actived.label dropdownActive :commandd.label :disabled d.label dropdownActive || $g.item.disabled({ item: d, index: i, scope: scope }) :dividedd.divided :typed.type el-badge classnew-badge :typedanger :valued.badge :hidden!d.badge i :class $g.item.getProperty({ property: icon, item: d, index: i, scope: scope }) v-if Boolean( $g.item.getProperty({ property: icon, item: d, index: i, scope: scope }) ) :style $g.item.getProperty({ property: iconStyle, item: d, index: i, scope: scope, }) /{{ d.label }}/el-badge /el-dropdown-item /el-dropdown-menu /el-dropdown /template script export default { name: sgMoreMenu, data() { return { text: 更多, scope: {}, dropdownActive: , dropdownItems: [ /* { hide: true, label: 编辑, clickEvent: ({ item, index, scope }) { this.edit(scope.row); }, }, { disabled: true, label: 重命名, icon: el-icon-edit, clickEvent: ({ item, index, scope }) { this.edit_rename(scope.row); }, }, { show: ({ item, index, scope }) scope.row.show, label: 分享, icon: el-icon-share, clickEvent: ({ item, index, scope }) { this.share(scope.row); }, }, { label: 下载, type: success, icon: el-icon-download, clickEvent: ({ item, index, scope }) { this.download(scope.row); }, }, { divided: true, label: 删除, icon: el-icon-delete, type: danger, clickEvent: ({ item, index, scope }) { this.del([scope.row]); }, }, */ ], buttonType: text, //text文本默认icon图标 dropdownMenuStyle: { transition: none, overflow-y: auto, max-height: 400px, margin-top: 5px, }, }; }, props: [value, data], watch: { data: { handler(newValue, oldValue) { // console.log(深度监听${this.$options.name}, newValue, oldValue); if (Object.keys(newValue || {}).length) { this.form newValue; //JSON.parse(JSON.stringify(newValue)); this.$g.cF2CP(disabled, this); this.$g.cF2CP(text, this); this.$g.cF2CP(dropdownItems, this); this.$g.cF2CP(dropdownActive, this); this.$g.cF2CP(scope, this); this.$g.cF2CP(buttonType, this); this.$g.cF2CP(dropdownMenuStyle, this); this.removeDivided(); } }, deep: true, //深度监听 immediate: true, //立即执行 }, }, computed: { showMoreBtn() { let arr this.dropdownItems.filter((item, index, ar) this.$g.item.show({ item, index, scope: this.scope }) ); return arr.length 0; }, }, methods: { removeDivided() { let arr this.dropdownItems.filter((item, index, ar) this.$g.item.show({ item, index, scope: this.scope }) ); arr.length 0 delete arr[0].divided; }, }, }; /script style langscss scoped .sgMoreMenu { } /style style langscss .sgMoreMenu-dropdown-menu { .el-badge__content.is-fixed { transform: translate(calc(100% 3px), -3px); } } /styledemotemplate div :class$options.name el-table :datatableData el-table-column typeindex label序号 width60 / !-- 主要列 BEGIN---------------------------------------- -- el-table-column label姓名 template slot-scopescope span{{ scope.row.name }}/span /template /el-table-column !-- 主要列 END---------------------------------------- -- el-table-column label操作 template slot-scopescope el-button sizemini typeprimary click.stopedit(scope.row) dblclick.native.stop 修改/el-button el-button sizemini typedanger click.stopdel(scope.row) dblclick.native.stop 删除/el-button !-- 更多操作 -- sgMoreMenu :data{ scope, dropdownItems: [ { hide: true, label: 编辑, clickEvent: ({ item, index, scope }) { this.edit(scope.row); }, }, { hide: ({ item, index, scope }) scope.row.hide, disabled: true, label: 重命名, icon: el-icon-edit, clickEvent: ({ item, index, scope }) { this.edit_rename(scope.row); }, }, { show: ({ item, index, scope }) scope.row.show, label: 分享, icon: el-icon-share, clickEvent: ({ item, index, scope }) { this.share(scope.row); }, }, { label: 下载, type: success, icon: el-icon-download, clickEvent: ({ item, index, scope }) { this.download(scope.row); }, }, { divided: true, label: 删除, icon: el-icon-delete, type: danger, clickEvent: ({ item, index, scope }) { this.del([scope.row]); }, }, ], } / /template /el-table-column /el-table /div /template script import sgMoreMenu from /vue/components/admin/sgMoreMenu; export default { name: moreDropdown, components: { sgMoreMenu }, data() { return { tableData: [ { name: 姓名1 }, { name: 姓名2, hide: true }, { name: 姓名3, show: true }, { name: 姓名4 }, { name: 姓名5 }, ], }; }, }; /script在此方法基础上扩展el-dropdown自定义“更多操作⌵”上下文关联按钮下拉菜单-CSDN博客文章浏览阅读520次。【代码】基于element UI el-dropdown打造表格操作列的“更多⌵”上下文关联菜单。_dropdown 更多操作 样式。基于element UI el-dropdown打造表格操作列的“更多⌵”上下文关联菜单_dropdown 更多操作 样式-CSDN博客。https://blog.csdn.net/qq_37860634/article/details/148902297基于element UI el-dropdown打造表格操作列的“更多⌵”上下文关联菜单_dropdown 更多操作 样式-CSDN博客文章浏览阅读520次。【代码】基于element UI el-dropdown打造表格操作列的“更多⌵”上下文关联菜单。_dropdown 更多操作 样式https://blog.csdn.net/qq_37860634/article/details/145044081

相关新闻

华为ensp作业练习题-实验四 路由选择协议RIP的配置

华为ensp作业练习题-实验四 路由选择协议RIP的配置

一、实验原理RIP协议是应用较早、使用较普遍的内部网关协议,适用于由同一个网络管理员管理的较小网络的路由选择协议。其特点有:RIP是典型的距离矢量(distance-vector)协议。RIP采用距离矢量算法,即路由器根据跳数作为度量标准来确定到给定目…

2026/7/11 16:32:17阅读更多 →
2026年微信小程序搭建一般需要多长时间?不同方案周期和延期点

2026年微信小程序搭建一般需要多长时间?不同方案周期和延期点

微信小程序搭建多久能完成,不能只听一句「很快」。真正决定周期的,是资料是否齐、功能是否标准、审核是否顺利、谁来改页面,以及上线后有没有测试流程。很多项目不是做得慢,而是业务资料一边做一边改。微信小程序搭建周期&#xf…

2026/7/10 15:27:43阅读更多 →
UE4SS技术架构深度解析:Unreal Engine游戏脚本系统的设计与实现

UE4SS技术架构深度解析:Unreal Engine游戏脚本系统的设计与实现

UE4SS技术架构深度解析:Unreal Engine游戏脚本系统的设计与实现 【免费下载链接】RE-UE4SS Injectable LUA scripting system, SDK generator, live property editor and other dumping utilities for UE4/5 games 项目地址: https://gitcode.com/gh_mirrors/re/R…

2026/7/10 15:27:43阅读更多 →
SAP 资产会计配置实战:5步解决折旧表分配与公司代码报错

SAP 资产会计配置实战:5步解决折旧表分配与公司代码报错

SAP资产会计配置实战:从折旧表分配到公司代码报错的深度解析在SAP资产会计(FI-AA)模块的实施过程中,折旧表分配与公司代码配置是基础但极易出错的关键环节。许多顾问在完成这些配置后,常会遇到"公司代码分录不完全…

2026/7/11 18:15:23阅读更多 →
致动终传JS13 Pro手柄DS输入模式深度配置与实战指南

致动终传JS13 Pro手柄DS输入模式深度配置与实战指南

最近在折腾游戏手柄时,发现一个很有意思的现象:很多玩家都在讨论致动终传JS13 Pro这款手柄的DS输入功能到底"好锁"在哪里。作为一个长期关注外设体验的技术爱好者,我决定深入测试一下这款手柄的真实表现。所谓"好锁"&…

2026/7/11 18:15:23阅读更多 →
Typora插件如何实现PDF批量导出与自定义导出功能:终极解决方案

Typora插件如何实现PDF批量导出与自定义导出功能:终极解决方案

Typora插件如何实现PDF批量导出与自定义导出功能:终极解决方案 【免费下载链接】typora_plugin Typora Plugin. Feature Enhancement Tool | Typora 插件,功能增强工具 项目地址: https://gitcode.com/gh_mirrors/ty/typora_plugin 作为一款广受欢…

2026/7/11 18:15:23阅读更多 →
GLM-5V-Turbo:前端工程中的像素级视觉接口层

GLM-5V-Turbo:前端工程中的像素级视觉接口层

1. 项目概述:这不是一个“升级版”,而是一次定位重构的实战手记GLM-5V-Turbo上线那天,我盯着智普官网的公告刷新了三遍,不是因为激动,而是因为困惑——它到底想解决什么问题?不是单纯比谁快、谁参数多、谁上…

2026/7/11 18:15:23阅读更多 →
TLA2518与PIC18F26K20构建高精度多通道ADC系统

TLA2518与PIC18F26K20构建高精度多通道ADC系统

1. 项目背景与核心需求在工业控制、医疗设备和消费电子等领域,模拟信号到数字信号的可靠转换一直是系统设计的关键环节。TLA2518作为德州仪器推出的12位精度、1MSPS采样率的8通道ADC芯片,配合PIC18F26K20这款高性价比的8位MCU,能够构建一个稳…

2026/7/11 18:15:22阅读更多 →
工业控制系统中电气隔离与TLP241A光耦应用解析

工业控制系统中电气隔离与TLP241A光耦应用解析

1. 电气隔离在工业控制系统中的核心价值工业控制系统中,电气隔离就像给电路装上了一道"防火墙"。我曾在多个工业现场亲眼目睹过没有隔离设计的系统在电机启停瞬间崩溃的场景。TLP241A光耦与STM32F427ZI的组合,正是为了解决这类痛点而生。电气隔…

2026/7/11 18:10:22阅读更多 →
从GitHub安全案例解析常见漏洞与防护实践

从GitHub安全案例解析常见漏洞与防护实践

1. 项目概述:从GitHub Trending看安全实战 最近在GitHub Trending上看到一个项目,叫 skills4/skills ,它因为一些安全漏洞案例被大家讨论。这其实是一个挺典型的场景:一个旨在展示或教授某种技能的仓库,本身却成了安…

2026/7/10 12:10:00阅读更多 →
MLT 2026启示:因果推理与概率建模驱动下一代LLM应用

MLT 2026启示:因果推理与概率建模驱动下一代LLM应用

# MLT 2026启示:因果推理与概率建模驱动下一代LLM应用## 一、背景与挑战:从“黑箱预测”到“可信推理”2026年6月,第7届机器学习与趋势国际会议(MLT 2026)将在悉尼召开。会议议程中,“因果与可解释机器学习…

2026/7/11 15:18:12阅读更多 →
通达OA SQL注入漏洞深度剖析:从手工注入到自动化利用与防御

通达OA SQL注入漏洞深度剖析:从手工注入到自动化利用与防御

1. 项目概述与漏洞背景最近在梳理一些历史OA系统的安全风险时,通达OA v11.6版本中的一个老漏洞又进入了我的视线。这个漏洞位于/general/bi_design/appcenter/report_bi.func.php文件中,是一个典型的SQL注入点。虽然这个漏洞的利用方式看起来并不复杂&am…

2026/7/11 15:11:32阅读更多 →
Premiere Pro 2025安装失败原因与AGSIS验证绕过指南

Premiere Pro 2025安装失败原因与AGSIS验证绕过指南

1. 为什么2025版PR安装比以往更“磨人”?——从弹窗警告到路径陷阱的真实处境 Premiere Pro 2025版不是简单的一次版本迭代,它是一道分水岭。我从去年底开始帮影视工作室、高校剪辑实验室和自由职业者部署2025环境,累计处理了137台设备&#…

2026/7/11 0:03:43阅读更多 →
5款实用macOS系统优化工具:让你的Mac运行更流畅更高效

5款实用macOS系统优化工具:让你的Mac运行更流畅更高效

5款实用macOS系统优化工具:让你的Mac运行更流畅更高效 【免费下载链接】open-source-mac-os-apps 🚀 Awesome list of open source applications for macOS. https://t.me/s/opensourcemacosapps 项目地址: https://gitcode.com/gh_mirrors/op/open-so…

2026/7/11 0:03:43阅读更多 →
5分钟完全掌握:ComfyUI ControlNet预处理器终极使用指南

5分钟完全掌握:ComfyUI ControlNet预处理器终极使用指南

5分钟完全掌握:ComfyUI ControlNet预处理器终极使用指南 【免费下载链接】comfyui_controlnet_aux ComfyUIs ControlNet Auxiliary Preprocessors 项目地址: https://gitcode.com/gh_mirrors/co/comfyui_controlnet_aux 想要让AI图像生成真正听从你的指挥吗&…

2026/7/11 0:03:43阅读更多 →
YOLOv8推理性能优化:从1.2FPS到35FPS的全链路加速实践

YOLOv8推理性能优化:从1.2FPS到35FPS的全链路加速实践

如果你在部署 YOLOv8 时,发现推理速度只有可怜的 1-2 FPS,而别人的演示视频却能跑到 30 FPS 以上,那么问题很可能不在模型本身,而在于你的整个处理链路。很多开发者拿到一个训练好的 YOLOv8 模型后,会直接使用官方示例…

2026/7/11 16:20:28阅读更多 →
Coze与Dify对比指南:低代码AI应用开发从入门到实战

Coze与Dify对比指南:低代码AI应用开发从入门到实战

1. 从零到一:为什么你需要了解 Coze 和 Dify?如果你对 AI 应用开发感兴趣,但一看到“大模型”、“智能体”、“工作流”这些词就头疼,觉得门槛太高,那这篇文章就是为你准备的。很多开发者,包括我自己&#…

2026/7/10 22:20:33阅读更多 →
AI生图工具怎么选?2026年6月版实测对比

AI生图工具怎么选?2026年6月版实测对比

做自媒体的朋友应该都有体会:配图一直是个让人头疼的问题。2026年,AI生图工具已经非常成熟了,但工具太多反而不知道怎么选。以下是截至2026年6月我对主流AI生图工具的实测对比。Midjourney V8.1:速度之王2026年6月11日&#xff0c…

2026/7/11 18:12:23阅读更多 →