上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 27 下一页
摘要: /* 并发加载函数 id:唯一值 syncFunc:加载函数 */ const _map={} const _startTimeMap={} async function conCurentLoad (id,syncFunc) { //兼容并发加载的情况 if(!_map[id]){ _map[id 阅读全文
posted @ 2021-09-24 11:18 无工时代 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 推荐一个离线应用框架-lcache.js http://www.lcache.tech/ 阅读全文
posted @ 2021-09-09 10:33 无工时代 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 痛点:在单页面应用中,一个路由文件包含了所有页面的配置。随着项目开发,页面越来越多,导致路由配置文件越来越大,而用户访问只需要很少的部分,造成了资源的浪费。 为解决这个问题,研究了路由拆分方案 思路:先分类后拆分 1、项目中有A、B、C等子项目或流程,对应A_xx页面、B_xx页面、C_xx页面, 阅读全文
posted @ 2021-08-04 16:20 无工时代 阅读(146) 评论(0) 推荐(0) 编辑
摘要: /** * iOS键盘收起页面未下移bug */(/iphone|ipod|ipad/i.test(navigator.appVersion))&&document.addEventListener('blur', (e) => { // 这里加了个类型判断,因为a等元素也会触发blur事件 ['i 阅读全文
posted @ 2021-07-22 14:41 无工时代 阅读(45) 评论(0) 推荐(0) 编辑
摘要: Array.prototype.pushOnly=function(one){ if(this.indexOf(one) 1){ this.push(one) } } /* * 分类器*/ class ArraySplit { constructor(getDis,sArr,maxDeep) { t 阅读全文
posted @ 2021-05-21 14:17 无工时代 阅读(39) 评论(0) 推荐(0) 编辑
摘要: const axios=require('axios') const fs = require('fs-extra'); const https=require('https') const path=require('path') function resolve (dir) { return p 阅读全文
posted @ 2021-05-20 18:29 无工时代 阅读(109) 评论(0) 推荐(0) 编辑
摘要: /* 缓存管理器 cacheLen:最多缓存多少个数据 id:唯一值 name:方法名 syncFunc:加载函数 */ class cacheManage { //cacheLen:最多缓存多少个数据 constructor(cacheLen){ this.cacheLen=cacheLen||2 阅读全文
posted @ 2021-05-20 13:05 无工时代 阅读(34) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>数据分类器demo</title> </head> <body> <button onclick="splitArr()">分类</button> <div i 阅读全文
posted @ 2021-05-19 16:26 无工时代 阅读(97) 评论(0) 推荐(0) 编辑
摘要: /* * 分类器*/ class ArraySplit { constructor(getDis) { this.getDis=getDis; } //计算元素key的最大长度dis、最大长度对应的元素arr getMaxKey(key1,indexArr,sArr) { const getDis= 阅读全文
posted @ 2021-05-13 16:59 无工时代 阅读(91) 评论(0) 推荐(0) 编辑
摘要: //欧几里得算法 求两个数a、b的最大公约数 function gcd(a,b){ return b 0?a:gcd(b,a%b) } //获取一个位置的相似度 function getOneSame(x,y,rect1,rect2){ let endn,n,i; const arrX=[] con 阅读全文
posted @ 2021-05-13 14:16 无工时代 阅读(90) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 27 下一页