摘要: npm install jszip file-saver --save import JSZip from 'jszip' import { saveAs } from 'file-saver' export const downloadFiles = (fileUrls, folderName = 阅读全文
posted @ 2024-01-04 15:13 懒惰ing 阅读(84) 评论(0) 推荐(0) 编辑
摘要: const list = [1, 2, 3] Array.prototype.myForeach = function (fn) { for (let i = 0; i < this.length; i++) { fn(this[i], i, this) } } Array.prototype.my 阅读全文
posted @ 2023-12-21 17:24 懒惰ing 阅读(10) 评论(0) 推荐(0) 编辑
摘要: class Observer { constructor(value){ this.value = value if(Array.isArray(value)){ // 数组的逻辑 }else { // 对象的逻辑 this.walk(value) } } walk(obj) { const key 阅读全文
posted @ 2023-02-04 21:17 懒惰ing 阅读(18) 评论(0) 推荐(0) 编辑
摘要: props import ElementUI from 'element-ui' Element.Input.props.clearable.default = true; 原生属性 通常情况下,以maxlength属性为例 import ElementUI from 'element-ui' co 阅读全文
posted @ 2023-01-10 11:13 懒惰ing 阅读(345) 评论(0) 推荐(0) 编辑
摘要: docx的实现需要使用docx-preview插件 安装 npm i docx-preview 使用 html <div ref="file"></div> import { renderAsync } from "docx-preview"; const docxOptions = { class 阅读全文
posted @ 2023-01-06 11:57 懒惰ing 阅读(632) 评论(0) 推荐(0) 编辑
摘要: ::-webkit-scrollbar { display: none; width: 0 !important; height: 0 !important; -webkit-appearance: none; background: transparent; } 阅读全文
posted @ 2023-01-03 16:34 懒惰ing 阅读(185) 评论(0) 推荐(1) 编辑
摘要: 在本地的时候,浏览器自动截取了第一帧作为视频的poster封面,但是到移动端,就展示空白 使用poster,值为视频地址添加后缀 '?x-oss-process=video/snapshot,t_1,m_fast' <video :src="videoUrl" :poster="videoUrl + 阅读全文
posted @ 2023-01-03 15:46 懒惰ing 阅读(870) 评论(0) 推荐(0) 编辑
摘要: <template> <!-- 省略其他配置 --> <el-upload ref="upload" :file-list.sync="fileList"></el-upload> </template> <script> import Sortable from 'sortablejs'; exp 阅读全文
posted @ 2022-12-14 17:42 懒惰ing 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 结构赋值的高阶用法 结构赋值对于引用嵌套的属性或目标没有限制。为此,可以通过结构来复制对象属性。 let obj1 = { a: 1, b: 2, c: 3 }; let obj2 = {}; ({ a: obj2.a,b: obj2.b } = obj1); console.log(obj2); 阅读全文
posted @ 2022-09-29 11:12 懒惰ing 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 订阅器模型 // 订阅器模型 const Dep = { clientList: {}, // 订阅 listen(key, fn) { (this.clientList[key] ??= []).push(fn) }, // 发布 trigger() { const key = Array.pro 阅读全文
posted @ 2022-09-15 14:26 懒惰ing 阅读(56) 评论(0) 推荐(0) 编辑