摘要:
一个组件需要请求远程得参数,暴露出对应得promise函数 ```ts export type ProductList = { total: number; list:Array } export type RequestData = { pageInfo:{currentPage:number,p 阅读全文
摘要:
通过canvas生成一个base64的字符串对于设备、操作系统、浏览器生成的 function uuid() { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); const t 阅读全文
摘要:
https://github.com/f/awesome-chatgpt-prompts javascript学习 Let’s roleplay. You are an online JavaScript course. Your task is to quickly assess the stud 阅读全文
摘要:
###工厂模式 function createPerson(name, age, job) { let o = new Object(); o.name = name; o.age = age; o.job = job; o.sayName = function() { console.log(th 阅读全文
摘要:
/** * 每个csv文件转成一个person对象,然后根据父子关系构建树 */ const transferTree = () => { interface Person { name: string age: number parent: string | null children?: Per 阅读全文
摘要:
You can use the following code to detect the different browsers: // Check for Chrome var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/ 阅读全文
摘要:
eruda是一个移动端调试得工具 const script = document.createElement('script') script.type = 'text/javascript' script.src = '//unpkg.zhimg.com/eruda' script.onload 阅读全文
摘要:
const equals = (a,b) =>{ if(a b) return true; if(a instanceof Date && b instanceof Date){ return a.getTime() b.getTime() } if(!a || !b || (typeof a != 阅读全文
摘要:
convertCurrency(money) { //汉字的数字 const cnNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; //基本单位 const cnIntRadice = ['', '拾', '佰', '仟']; // 阅读全文