摘要: 对象合并 const obj = { id: null, count: null, completed: null, }; // 假设这是接口返回的对象 const data = { id: 1, count: 2, completed: 3, otherParam:{ // 返回的其他无用字段 } 阅读全文
posted @ 2022-09-05 16:35 Yune_Neko 阅读(41) 评论(0) 推荐(0) 编辑
摘要: <article> <!-- 左侧区域--> <el-scrollbar class="left-aside"> <!-- 780px --> <div class="left-content"></div> </el-scrollbar> <!-- 右侧区域 --> <el-scrollbar c 阅读全文
posted @ 2022-08-25 16:42 Yune_Neko 阅读(954) 评论(0) 推荐(0) 编辑
摘要: 表格切换分页时将表格滚动到顶部 this.$refs.tableComponent.bodyWrapper.scrollTo({ top: 0, behavior: "smooth", }); tableComponent为表格组件的实例 关闭弹窗后将弹窗的滚动条回到顶部 this.$refs.di 阅读全文
posted @ 2022-08-15 11:20 Yune_Neko 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 写在前面 不再推荐使用yarn3,推荐使用pnpm作为项目包管理器,简单不折腾 https://pnpm.io/zh/ 安装过程 当前工作区内的文件如下 首先当然是安装 yarn,此命令可在任何地方执行 npm install -g yarn 查看版本,会发现版本并不是 3.因为版本 1 是经典版 阅读全文
posted @ 2022-07-14 10:37 Yune_Neko 阅读(799) 评论(9) 推荐(0) 编辑
摘要: 针对ElementUI的写法.如果你未使用ElementUI,则直接拿代码中的正则表达式片段即可 // 验证姓名 function checkName(rule, value, callback) { const nameReg = /^[\u4E00-\u9FA5]{2,4}$/; if (!na 阅读全文
posted @ 2022-06-02 15:32 Yune_Neko 阅读(38) 评论(0) 推荐(1) 编辑
摘要: in操作符作用: 遍历类型 基本用法 type roles = "tester" | "developer" | "manager"; const staffCount: { [k in roles]: number } = { tester: 100, developer: 200, manage 阅读全文
posted @ 2022-05-20 11:23 Yune_Neko 阅读(2851) 评论(0) 推荐(0) 编辑
摘要: 索引:对象或数组的对应位置的名字 数组的索引就是 number 类型的 0,1,2,3... 对象的索引就是 string 类型的属性名 数字索引签名:通过定义接口用来约束数组 type numberIndex{ [index:number]:string } const testArray:num 阅读全文
posted @ 2022-05-19 10:14 Yune_Neko 阅读(2419) 评论(0) 推荐(0) 编辑
摘要: class A { constructor() { this.inside = function () {}; } outside() {} } const a1 = new A(); const a2 = new A(); console.log(a1.outside a2.outside); / 阅读全文
posted @ 2022-05-11 14:24 Yune_Neko 阅读(259) 评论(1) 推荐(0) 编辑
摘要: 有什么用? 可以让你在 VSCODE 里打的断点在浏览器中可用 运行时发生的错误在 VSCODE 中可以更直观的发现 安装 Debugger for Firefox 配置 在项目根目录的.vscode目录(没有则新建)中新建launch.json. 基本配置项,针对Vue项目 { "configur 阅读全文
posted @ 2022-03-16 15:00 Yune_Neko 阅读(2518) 评论(3) 推荐(0) 编辑
摘要: 初识 async 函数表示这个函数内部有异步请求,如果这个 async 函数没有返回值,那么这个 async 仅仅只是一个标识而已. await 需要结合 async 函数一起使用,它通常用于等待一个 Promise 函数或 async 函数的执行(你当然可以写个await 123,但这不会有任何作 阅读全文
posted @ 2022-01-17 14:15 Yune_Neko 阅读(325) 评论(0) 推荐(0) 编辑