摘要: 由于之前搜索其他modal框封装的文章时,发现大多数在使用时需要引入并注册组件,传入参数再写方法。每次引用时都要经过上述操作,觉得太麻烦了。后面通过一些资料摸索出vue3如何利用命令方式(即避免写组件标签)来弹出弹框,写下这篇文章,方便日后自己复习 调用及效果 先上使用方法及效果 代码 <templ 阅读全文
posted @ 2023-04-20 00:46 Monday1997 阅读(790) 评论(0) 推荐(0) 编辑
摘要: 性能优化,简述三种懒加载方式及对比 阅读全文
posted @ 2023-02-14 23:01 Monday1997 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 这两天需要用到drag,又回头把知识捡了起来,这里简单的记录一下 页面布局与样式 基本样式如下,除了要设置draggable="true"没什么需要注意的 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta nam 阅读全文
posted @ 2021-08-05 23:25 Monday1997 阅读(267) 评论(0) 推荐(0) 编辑
摘要: import XLSX from 'xlsx' // 引入之后 下面是转json和excel _toJson (e) { let file = e.target.files[0] let reader = new FileReader() reader.onload = (event) => { c 阅读全文
posted @ 2021-06-10 17:37 Monday1997 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 原生call的实现方法 原理: 当调用call时,call方法中的this就是调用体(也就是调用call的函数) 此时只需要将this赋值给传进来的对象,作为对象的方法进行调用,这样这个方法的this便会指向目标对象。当传进来的对象为null的时候,直接赋值为window 参数问题,,利用自带的ar 阅读全文
posted @ 2021-06-01 21:27 Monday1997 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 利用jsBarCode可将字符串转为条形码 先创建一个画布 <canvas id="barcode" class="barcode1"></canvas> 再用JsBarcode进行绘画 import JsBarcode from 'jsbarcode' // displayValue是设定是否默认 阅读全文
posted @ 2021-05-28 11:17 Monday1997 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 这几天项目中有个需求,是对数据进行批量操作 上传时候需要把excel转为json发给后端,而在导出时需要将json转为excel文件 我是借用了xlsx这个库来完成的,在此记录一下 先npm i xlsx安装相关依赖 设置一个input用于 <input type="file" name="file 阅读全文
posted @ 2021-05-26 13:36 Monday1997 阅读(956) 评论(0) 推荐(0) 编辑
摘要: js实现点击复制 mdn参考此处 <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1. 阅读全文
posted @ 2021-05-19 18:01 Monday1997 阅读(518) 评论(0) 推荐(0) 编辑
摘要: 在开发中用axios请求时,偶尔需要使用qs对数据做如下处理, a:[1,2,3,4] => a=1&a=2&a=3&a=4 在此记录一下 axios是自带qs因此无需再下载,可直接操作qs.stringify(params, ), import qs from 'qs ... //引用时将para 阅读全文
posted @ 2021-05-18 16:26 Monday1997 阅读(423) 评论(0) 推荐(0) 编辑
摘要: 父级 <temp> <template v-slot:slot1="slotProps"> {{slotProps.slotData}} </template> </temp> 子级 <slot name="slot1" :slotData = "'sssss'"></slot> 阅读全文
posted @ 2021-05-18 16:11 Monday1997 阅读(1430) 评论(0) 推荐(0) 编辑