随笔分类 -  JavaScript

摘要:const {width, height} = await this.getImgSize(base64) async getImgSize(base64) { const image = new Image() image.crossOrigin = '' image.src = base64 r 阅读全文
posted @ 2022-11-07 15:14 非帆丶 阅读(280) 评论(0) 推荐(0) 编辑
摘要:aDownload(url, fileName) { const link = document.createElement('a') link.style.display = 'none' link.href = url link.download = fileName // link.setAt 阅读全文
posted @ 2022-11-07 15:11 非帆丶 阅读(447) 评论(0) 推荐(0) 编辑
摘要:timeFormatting(val) { let time = val.slice(0, 10) // 兼容IOS time = time.replace(/-/g, '/') let date = new Date(time); let Y = date.getFullYear() let M 阅读全文
posted @ 2022-11-07 15:10 非帆丶 阅读(306) 评论(0) 推荐(0) 编辑
摘要:一、姓名脱敏 handleName(name) { let arr = Array.from(name) let result = '' if (arr.length 2) { result = arr[0] + '*' } else if (arr.length > 2) { for (let i 阅读全文
posted @ 2022-11-07 15:09 非帆丶 阅读(3387) 评论(0) 推荐(0) 编辑
摘要:const response = await window.fetch(url,{ method:'post', body:body, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }) if (response.o 阅读全文
posted @ 2022-06-24 21:44 非帆丶 阅读(880) 评论(0) 推荐(0) 编辑
摘要:学习视频:https://www.bilibili.com/video/BV1cE411j7bB?spm_id_from=333.337.search-card.all.click 指定条件排序 https://www.cnblogs.com/zhaozhou/p/10761471.html htt 阅读全文
posted @ 2022-05-13 10:19 非帆丶 阅读(114) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/52067191355a https://www.jb51.net/article/130303.htm https://www.csdn.net/tags/MtjaEg2sNjQwMTYtYmxvZwO0O0OO0O0O.html 阅读全文
posted @ 2022-04-14 17:05 非帆丶 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-02-20 18:07 非帆丶 阅读(40) 评论(0) 推荐(0) 编辑
摘要:setTimeout(要执行的代码, 等待的毫秒数) setTimeout(JavaScript 函数, 等待的毫秒数) setTimeout(() => { //2s后执行代码执行 }, 2000) //等待2s 阅读全文
posted @ 2021-12-12 21:12 非帆丶 阅读(876) 评论(0) 推荐(0) 编辑
摘要:一、数组合并 方法一、for循环实现数组合并 代码如下: let arr1 = ['a','b','c'] let arr2 = [1,2,3] for (let i in arr2) { arr1.push(arr2[i]) } console.log("arr1:",arr1) console. 阅读全文
posted @ 2021-12-12 20:15 非帆丶 阅读(1099) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示