02 2022 档案
异步加载图片体验js任务操作
摘要:function load(src,resolve,reject){ let image=new Image(); image.src=src; image.onload=resolve; image.onerror=reject; } load( "../images/1.jpg", ()=>{ 阅读全文
posted @ 2022-02-01 15:57 weakup 阅读(115) 评论(0) 推荐(0)
模块管理引擎
摘要:let module=(function(){ const moduleList={}; function define(name,modules,action){ modules.map((m,i)=>{ modules[i]=moduleList[m]; }) moduleList[name]= 阅读全文
posted @ 2022-02-01 11:32 weakup 阅读(31) 评论(0) 推荐(0)
使用instanceof检测对象实现
摘要:function User(){} function Admin(){} Admin.prototype=Object.create(User.prototype); let hd=new Admin(); console.log(hd instanceof Admin); console.log( 阅读全文
posted @ 2022-02-01 09:53 weakup 阅读(45) 评论(0) 推荐(0)