合集-代码片段

摘要:使用axios下载文件时,当下载出错,后端返回错误信息时,需要先通过FileReader将Blob对象转换为文本,然后将文本转换为JSON对象,最后将JSON对象中的message属性作为错误信息展示给用户。 const fileReader = new FileReader(); fileRead 阅读全文
posted @ 2024-05-09 09:58 coderjnp 阅读(23) 评论(0) 推荐(0) 编辑
摘要:// 节流 function throttle(fn, delay, asThis) { let timer = null; return (...args) => { if (timer) return fn.call(asThis, ...args) timer = setTimeout(() 阅读全文
posted @ 2024-06-06 13:27 coderjnp 阅读(6) 评论(0) 推荐(0) 编辑

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