el-table封装popver組件,点击列筛选行数据功能,支持筛选,搜索,排序功能
子组件:
<template><div class="tableTool" ref="tableTool" @click.stop><el-button @click="shengFnc">升序</el-button><el-button @click="jiangFnc">降序</el-button><el-input v-model="keyword" prefix-icon="el-input__icon el-icon-search" type="text" placeholder="搜索"@blur="blurFnc"></el-input><div class="select-box"><el-checkbox v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox><el-checkbox-group v-model="checkedList"><el-checkbox v-for="(item, index) in CheckboxArr" :label="item.id" :key="index" :value="item.id"><span>{{ item[type] }}</span></el-checkbox></el-checkbox-group></div><div class="bottom"><el-button size="mini" @click="$emit('closeTool')">取消</el-button><el-button type="primary" size="mini" @click="save">确认</el-button></div></div>
</template>
<script>
export default {name: "tableCol",props: {ids: {type: Array},type: {type: String}},data() {return {keyword: "",checkAll: false,checkedList: [],options: [],isIndeterminate: true,allOptions: [],CheckboxArr: JSON.parse(localStorage.getItem('CheckboxArr')),c: [],elementObj: {},tableToolelSize: {},zishenkuandu: 0};},methods: {shengFnc() {this.CheckboxArr.sort((a, b) => a.id - b.id);},jiangFnc() {this.CheckboxArr.sort((a, b) => b.id - a.id);},blurFnc() {// console.log(this.keyword);if (this.keyword) {this.CheckboxArr = this.CheckboxArr.filter(item => {if (this.$props.type == 'date') {return item.date == this.keyword;} else {return item.name == this.keyword;}});} else {this.CheckboxArr = JSON.parse(localStorage.getItem('CheckboxArr'))}},handleCheckAllChange(val) {// console.log(val, this.checkedList);this.checkedList = val ? this.CheckboxArr.map(item => item.id) : [];},save() {this.c = []this.CheckboxArr.forEach(r => {this.checkedList.forEach(i => {if (r.id == i) {this.c.push(r)}})})this.$emit("saveSeach", this.c);},},mounted() {// console.log(this.CheckboxArr, JSON.parse(this.$props.elementPosition), "传入的数据");this.checkedList = [...this.$props.ids]if (this.CheckboxArr.length == this.checkedList.length) {this.checkAll = true} else {this.checkAll = false}},};
</script><style scoped>
.tableTool {/* position: fixed; */background: #fff;box-shadow: 0 0 5px #ccc;padding: 10px;z-index: 999;}/deep/.el-input__inner {padding-left: 30px;
}.select-box {border: #ccc solid 1px;padding: 10px;margin-top: 10px;max-height: 280px;overflow: auto;max-width: 400px;
}/deep/ .el-checkbox {display: block;margin-top: 5px;
}/deep/ .el-radio-group {display: flex;flex-direction: column;
}.bottom {display: flex;justify-content: flex-end;margin-top: 10px;
}.el-checkbox:last-of-type {margin-right: none;
}
</style>
父组件:
<template><div class="home"><!-- <img alt="Vue logo" src="../assets/logo.png"><HelloWorld msg="Welcome to Your Vue.js App" /> --><el-button @click="dialogVisible = true">求和</el-button><el-input v-model="searchValue"></el-input><el-steps :active="3" simple><el-step title="步骤 1" icon="el-icon-edit"></el-step><el-step title="步骤 2" icon="el-icon-upload"></el-step><el-step title="步骤 3" icon="el-icon-picture"></el-step></el-steps><el-table :data="tableData" height="250" border style="width: 100%;position: relative;" id="table1"><el-table-column prop="date" label="日期" width="180" align="center"><template v-slot:header><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'date')"></div><span class="table-heard-filter" style="color: red; font-weight: bold;">0</span></template></el-table-column><el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column> <el-table-column prop="name" label="姓名" width="120" align="center"><template v-slot:header><el-checkbox v-model="checked2" style="float: left;"></el-checkbox><div style="width: 20px;height: 20px;background: rebeccapurple;float: right;"@click.stop="filterData($event, 'name')"></div><span class="table-heard-filter">1</span></template></el-table-column></el-table><div v-if="showFilterTool" ref="popover" class="popover" :style="popoverStyle" style="position: absolute;"><TableTool ref="selectTool" @closeTool="closeTool" @saveSeach="saveSeach" :ids="ids" :type="type" /></div><i v-if="showFilterTool" class="el-icon-caret-top" :style="{ left: a + 'px', top: b + 20 + 'px' }"style="position: absolute;"></i><el-dialog title="提示" :visible.sync="dialogVisible" width="30%"><span slot="footer" class="dialog-footer"><span>{{ form.address }}</span><span>{{ form.name }}</span><span>{{ form.password }}</span><el-button @click="dialogVisible = false">取 消</el-button><el-button type="primary" @click="dialogVisible = false">确 定</el-button><el-button type="primary" @click="share(form)">复制</el-button><el-button type="primary"@click="printFnc('https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641', 'jpeg')">打印</el-button></span></el-dialog><div style="width: 200px;height: 20px;background: rebeccapurple;position: fixed;top: 20px;left:20px"ref="pageContainer" @click="filterData"></div></div>
</template><script>
import HelloWorld from '@/components/HelloWorld.vue'
import TableTool from '@/components/TableTool.vue'
import ColumnDialog from './ColumnDialog.vue'
import { Checkbox } from 'element-ui';
import watermark from '@/utils/watermark.js'
import printJS from 'print-js'
export default {name: 'HomeView',components: {HelloWorld,TableTool,ColumnDialog},computed: {popoverStyle() {return {left: this.popoverPosition.left + 'px',top: this.popoverPosition.top + 14 + 'px',};},},data() {return {a: "",b: "",popoverPosition: { left: 0, top: 0 },form: {address: "https://www.baidu.com/", // 地址信息name: "张三",password: "123",},isShow: false,dialogVisible: false,checked: false,checked2: false,summaryShow: false,summary: [], // 用于存放总计数据的数组searchValue: "",CheckboxArr: [],ids: [], // 初始化ids为空数组type: "",currentSummaryColumn: null, // 当前点击的列名tableData: [{date: '2016-05-03',name: 56,address: 8,id: "0"}, {date: '2016-05-02',name: 78,address: 8,id: "1"}, {date: '2016-05-04',name: 0,address: 8,id: "2"}],showFilterTool: false,CheckboxArr: [],ids: [],type: "",currentSummaryColumn: null // 当前点击的列名}},mounted() {localStorage.setItem('CheckboxArr', JSON.stringify(this.tableData))this.closeTableToolFnc()//添加水印// console.log(this.$refs.pageContainer);// watermark.set('1234567', '谁在花里胡哨', this.$refs.pageContainer)},beforeDestroy() {this.closeTableToolFnc()},methods: {// 判断是否是 IE 浏览器isIE() {if (window.ActiveXObject || "ActiveXObject" in window) {return true;} else {return false;}},share(url) {if (this.isIE()) {this.$copyText(this.form.password);// this.$refs.addressInput.select(); // 实现选中效果this.$message.success("复制成功!");} else {let obj = {'地址': this.form.address,'用户名': this.form.name,'密码': this.form.password}const objectString = JSON.stringify(obj);this.$copyText(objectString).then((res) => {// this.$refs.addressInput.select(); // 实现选中效果this.$message.success("复制成功!");}).catch((err) => {this.$message.error("该浏览器不支持自动复制, 请手动复制");})}},printFnc(url, filetype) {let path = urllet type = ''const acceptedFileTypes = ['png', 'jpeg', 'jpg', 'gif'];console.log(acceptedFileTypes.includes(filetype));if (acceptedFileTypes.includes(filetype)) {type = 'image'} else {type = filetype}printJS({printable: path,type: type,// showModal: true,//开启加载modalonErrorL: (err) => {return this.$message({type: "error",message: '打印失败,请检查打印机设置或尝试保存文件!'})}})},//子组件只用@click.stop防止事件冒泡,父组件单击任意位置关闭子组件closeTableToolFnc() {document.addEventListener("click", (e) => {this.closeTool()});},filterData(e, type) {this.type = typethis.showFilterTool = true;this.$nextTick(() => {const buttonRect = e.target.getBoundingClientRect();const popoverRect = this.$refs.popover.getBoundingClientRect();this.a = buttonRect.leftthis.b = buttonRect.topconsole.log(buttonRect.left);let leftPosition = buttonRect.left - (popoverRect.width - buttonRect.width) / 2;// 调整popover位置,防止超出可视范围if (leftPosition < 0) {leftPosition = 10;} else if (leftPosition + popoverRect.width > window.innerWidth) {leftPosition = window.innerWidth - popoverRect.width - 10;}this.popoverPosition = {left: leftPosition,top: buttonRect.bottom,};this.ids = []this.tableData.forEach(t => {this.ids.push(t.id)})this.showFilterTool = true;});},closeTool() {this.showFilterTool = false;},saveSeach(data) {this.tableData = []this.tableData = datathis.closeTool();},}}
</script>
<style>
.Tableone ::-webkit-scrollbar,
::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb {display: none
}.el-icon-caret-top {/* position: absolute; */color: #999;/* top: -13px; */font-size: 20px;}
</style>
效果:


相关文章:
el-table封装popver組件,点击列筛选行数据功能,支持筛选,搜索,排序功能
子组件: <template><div class"tableTool" ref"tableTool" click.stop><el-button click"shengFnc">升序</el-button><el-button click"jiangFnc">降序</el-button><el-input v-m…...
基于DPU的云原生计算资源共池管理解决方案
1. 方案背景和挑战 在传统的云环境中,通常存在着不同的技术栈,支撑多样化的计算服务,具体如下: ① OpenStack环境与虚拟化云主机及裸金属服务 OpenStack是一个开源的云计算管理平台项目,它提供了部署和管理大规模计…...
Bugly并非无所不能
在 iOS 应用因为内存占用过大而被系统 killed 的情况下,Bugly 以及大多数崩溃报告工具是无法捕获到这种类型的崩溃信息的。原因在于,当系统由于内存压力过大而终止应用时,是直接将应用进程杀死,不会触发常规的崩溃处理流程&#x…...
2024年信息系统项目管理师1批次上午客观题参考答案及解析(3)
51、探索各种选项,权衡包括时间与成本、质量与成本、风险与进度、进度与质量等多种因素,在整个过程中,舍弃无效或次优的替代方案,这种不确定性应对方法是()。 A.集合设计 B.坚韧性 C.多种结果…...
YOLOv8改进 | 注意力机制 | 对密集和小目标友好的EVAblock 【原理 + 完整代码】
秋招面试专栏推荐 :深度学习算法工程师面试问题总结【百面算法工程师】——点击即可跳转 💡💡💡本专栏所有程序均经过测试,可成功执行💡💡💡 专栏目录 :《YOLOv8改进有效…...
高效前端开发:解密pnpm的存储与链接
什么是pnpm PNPM(Performant NPM)是一种快速且节省磁盘空间的包管理工具。相较于其他包管理器如NPM和Yarn,PNPM通过独特的存储机制和链接技术解决了许多常见的问题。以下是PNPM如何避免这些问题以及其关键技术的详细介绍。 特性 PNPM Store…...
设置单实例Apache HTTP服务器
配置仓库 [rootlocalhost ~]# cd /etc/yum.repos.d/ [rootlocalhost yum.repos.d]# vi rpm.repo仓库代码: [BaseOS] nameBaseOS baseurl/mnt/BaseOS enabled1 gpgcheck0[AppStream] nameAppStream baseurl/mnt/AppStream enabled1 gpgcheck0挂载 [rootlocalhost …...
Python | Leetcode Python题解之第221题最大正方形
题目: 题解: class Solution:def maximalSquare(self, matrix: List[List[str]]) -> int:if len(matrix) 0 or len(matrix[0]) 0:return 0maxSide 0rows, columns len(matrix), len(matrix[0])dp [[0] * columns for _ in range(rows)]for i in…...
使用Python实现线性拟合
如下 Python 代码主要用于处理和分析数据,并使用 Matplotlib 库绘制出数据的拟合曲线。它的主要步骤包括数据预处理、进行线性回归分析,并根据结果绘图展示。下面是对代码及其所引用库的详细解释: 引用的库 numpy (np): 用于进行数值计算。这…...
如何在浏览器控制台Console中引入外部 JS
想要在某个网页执行一些脚本,却发现某个工具类,如 ajax 请求的 axios 该网页没有引入,或者引入了但控制台却访问不到,这时要怎么办呢? 只需要控制台执行如下代码就好了 var script document.createElement(script);…...
后端——全局异常处理
一、老办法try-catch 当我们执行一些错误操作导致程序报错时,程序会捕捉到异常报错,这个异常会存在一个Exception对象里 那我们在spring boot工程开发时,当我们执行一个sql查询时报错了,那就会从最底层的Mapper层捕捉到Exceptio…...
软件开发面试题(C#语言,.NET框架)
1. 解释什么是委托(Delegate),并举例说明它在C#中的用法。 委托是一种引用类型,它可以用于封装一个或多个方法。委托对象可以像方法一样调用,甚至可以用于创建事件处理程序。委托是C#中实现事件和回调函数的重要机制。…...
Spring学习04-[Spring容器核心技术AOP学习]
AOP学习 AOP介绍使用对业务方法添加计算时间的增强 EnableAspectJAutoProxyAOP的术语通知前置通知Before后置通知After返回通知AfterReturning异常通知AfterThrowing总结-通知执行顺序 切点表达式的提取-使用Pointcut进行抽取切点表达式的详细用法execution和annotation组合 Sp…...
第5章-组合序列类型
#全部是重点知识,必须会。 了解序列和索引|的相关概念 掌握序列的相关操作 掌握列表的相关操作 掌握元组的相关操作 掌握字典的相关操作 掌握集合的相关操作1,序列和索引 1,序列是一个用于存储多个值的连续空间,每一个值都对应一…...
大话光学原理:2.最短时间原理、“魔法石”与彩虹
一、最短时间原理 1662年左右,费马在一张信纸的边角,用他那著名的潦草笔迹,随意地写下了一行字:“光在两点间选择的路,总是耗时最少的。”这句话,简单而深邃,像是一颗悄然种下的种子,…...
spring tx @Transactional 详解 `Advisor`、`Target`、`ProxyFactory
在Spring中,Transactional注解的处理涉及到多个关键组件,包括Advisor、Target、ProxyFactory等。下面是详细的解析和代码示例,解释这些组件是如何协同工作的。 1. 关键组件介绍 1.1 Advisor Advisor是一个Spring AOP的概念,它包…...
`CyclicBarrier` 是 Java 中的一个同步辅助工具类,它允许一组线程相互等待,直到所有线程都达到了某个公共屏障点(barrier point)
CyclicBarrier 是 Java 中的一个同步辅助工具类,它允许一组线程相互等待,直到所有线程都达到了某个公共屏障点(barrier point)。当所有线程都到达屏障点时,它们可以继续执行后续操作。CyclicBarrier 的特点是可以重复使…...
华为机试HJ108求最小公倍数
华为机试HJ108求最小公倍数 题目: 想法: 要找到输入的两个数的最小公倍数,这个最小公倍数要大于等于其中最大的那个数值,遍历最大的那个数值的倍数,最大的最小公倍数就是输入的两个数值的乘积 input_number_list i…...
Debezium报错处理系列之第114篇:No TableMapEventData has been found for table id:256.
Debezium报错处理系列之第114篇:Caused by: com.github.shyiko.mysql.binlog.event.deserialization.MissingTableMapEventException: No TableMapEventData has been found for table id:256. Usually that means that you have started reading binary log within the logic…...
开发者必看:MySQL主从复制与Laravel读写分离的完美搭配
介绍 主从同步配置的主要性不用多说,本文将详细介绍了如何在MySQL数据库中设置主从复制,以及如何在Laravel框架中实现数据库的读写分离。 通过一系列的步骤,包括修改MySQL配置、创建同步账户、获取二进制日志文件名和位置、导出主服务器数据…...
网络六边形受到攻击
大家读完觉得有帮助记得关注和点赞!!! 抽象 现代智能交通系统 (ITS) 的一个关键要求是能够以安全、可靠和匿名的方式从互联车辆和移动设备收集地理参考数据。Nexagon 协议建立在 IETF 定位器/ID 分离协议 (…...
【网络】每天掌握一个Linux命令 - iftop
在Linux系统中,iftop是网络管理的得力助手,能实时监控网络流量、连接情况等,帮助排查网络异常。接下来从多方面详细介绍它。 目录 【网络】每天掌握一个Linux命令 - iftop工具概述安装方式核心功能基础用法进阶操作实战案例面试题场景生产场景…...
PPT|230页| 制造集团企业供应链端到端的数字化解决方案:从需求到结算的全链路业务闭环构建
制造业采购供应链管理是企业运营的核心环节,供应链协同管理在供应链上下游企业之间建立紧密的合作关系,通过信息共享、资源整合、业务协同等方式,实现供应链的全面管理和优化,提高供应链的效率和透明度,降低供应链的成…...
C# 类和继承(抽象类)
抽象类 抽象类是指设计为被继承的类。抽象类只能被用作其他类的基类。 不能创建抽象类的实例。抽象类使用abstract修饰符声明。 抽象类可以包含抽象成员或普通的非抽象成员。抽象类的成员可以是抽象成员和普通带 实现的成员的任意组合。抽象类自己可以派生自另一个抽象类。例…...
Java面试专项一-准备篇
一、企业简历筛选规则 一般企业的简历筛选流程:首先由HR先筛选一部分简历后,在将简历给到对应的项目负责人后再进行下一步的操作。 HR如何筛选简历 例如:Boss直聘(招聘方平台) 直接按照条件进行筛选 例如:…...
JAVA后端开发——多租户
数据隔离是多租户系统中的核心概念,确保一个租户(在这个系统中可能是一个公司或一个独立的客户)的数据对其他租户是不可见的。在 RuoYi 框架(您当前项目所使用的基础框架)中,这通常是通过在数据表中增加一个…...
AGain DB和倍数增益的关系
我在设置一款索尼CMOS芯片时,Again增益0db变化为6DB,画面的变化只有2倍DN的增益,比如10变为20。 这与dB和线性增益的关系以及传感器处理流程有关。以下是具体原因分析: 1. dB与线性增益的换算关系 6dB对应的理论线性增益应为&…...
Golang——7、包与接口详解
包与接口详解 1、Golang包详解1.1、Golang中包的定义和介绍1.2、Golang包管理工具go mod1.3、Golang中自定义包1.4、Golang中使用第三包1.5、init函数 2、接口详解2.1、接口的定义2.2、空接口2.3、类型断言2.4、结构体值接收者和指针接收者实现接口的区别2.5、一个结构体实现多…...
WPF八大法则:告别模态窗口卡顿
⚙️ 核心问题:阻塞式模态窗口的缺陷 原始代码中ShowDialog()会阻塞UI线程,导致后续逻辑无法执行: var result modalWindow.ShowDialog(); // 线程阻塞 ProcessResult(result); // 必须等待窗口关闭根本问题:…...
macOS 终端智能代理检测
🧠 终端智能代理检测:自动判断是否需要设置代理访问 GitHub 在开发中,使用 GitHub 是非常常见的需求。但有时候我们会发现某些命令失败、插件无法更新,例如: fatal: unable to access https://github.com/ohmyzsh/oh…...
