摘要: const testData = [ { value: '1', label: 'Level one 1', children: [ { value: '1-1', label: 'Level two 1-1', children: [ { value: '1-1-1', label: 'Level 阅读全文
posted @ 2024-01-04 11:46 流弊的小涛 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 异步编码规范 手写promise promise A+ 规范 async await 原理 generator -- 忽略 Promise 1.特点 1.1 状态不可逆转==》不可从一个状态变为另外一个状态 promise的方法 finally finally 方法没有参数,也不会改变 Promis 阅读全文
posted @ 2023-12-18 12:13 流弊的小涛 阅读(2) 评论(0) 推荐(0) 编辑
摘要: demon1 function test(){ console.log(b); //undefined if(a){ var b = 100; } console.log(b) ////undefined c = 234; console.log(c) //234 } var a; test(); 阅读全文
posted @ 2023-12-16 17:32 流弊的小涛 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 手写Call Function.prototype.MyCall = function(context){ var context = context ?? window; let fnSymbol = Symbol(); context[fnSymbol] = this; const arg = 阅读全文
posted @ 2023-12-16 16:52 流弊的小涛 阅读(6) 评论(0) 推荐(0) 编辑
摘要: import { customRef } from "vue"; /** * @description 自定义ref实现防抖 * @param {String} value * @param {Number} delay * @returns */ export const debounceRef 阅读全文
posted @ 2023-12-10 16:11 流弊的小涛 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 最常见的方法是设置一个误差范围值,通常称为“机器精度”。从ES6开始,该值定义在Number.EPSILON中,可以直接拿来用,也可以为ES6之前的版本写polyfill; if(!Number.EPSILON){ Number.EPSILON = Math.pow(2,-52) }` 可以用以下方 阅读全文
posted @ 2023-11-12 17:30 流弊的小涛 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 一、是什么 单点登录(Single Sign On),简称为 SSO,是目前比较流行的企业业务整合的解决方案之一 SSO的定义是在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的应用系统 SSO 一般都需要一个独立的认证中心(passport),子系统的登录均得通过passport,子系统 阅读全文
posted @ 2023-10-12 14:31 流弊的小涛 阅读(28) 评论(0) 推荐(0) 编辑
摘要: Promise.all是一个在JavaScript中常见的函数,用于处理一个Promise数组。当数组中的所有Promise都完成时,Promise.all将返回一个新的Promise,该Promise将解析为包含所有输入Promise解析值的数组。如果任何一个Promise失败,返回的Promis 阅读全文
posted @ 2023-09-21 16:47 流弊的小涛 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 把svg文件丢到 `lib/clearsvgcolor` 文件夹内,并在此文件夹内启动cmd 输入命令 `node index`,脚本执行完成就去色成功了 如果出现 error: -4058,把本地服务关闭再重新执行命令 const fs = require('fs'); const files = 阅读全文
posted @ 2023-09-19 14:33 流弊的小涛 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-02-14 21:18 流弊的小涛 阅读(32) 评论(0) 推荐(0) 编辑