随笔分类 - JS
摘要:最近公司项目碰到一个问题,就是$on $off的用法问题 是这么封装的(因为是用的qiankun,eventbus挂载到window上了)。 export async function getPatients(fn) { window.eventBus.$on(events.GET_PATIENT_
阅读全文
摘要:一、行政区获取 公司需要做大屏数据展示,地图地区需要到街道级别。 查看了不少资料。 目前的解决方案是,省市级别的数据在阿里地图选择器下载( http://datav.aliyun.com/tools/atlas/),可以做到县级下钻,如果要下钻到街道级别,则需要网上找这部分数据(找了很多,不大靠谱。
阅读全文
摘要:Object.prototype.clone = function(){ var o = this.constructor Array ? [] : {} for(var e in this){ o[e] = typeof this[e] == 'object' ? this[e].clone()
阅读全文
摘要:// 原型 console.log(Array.prototype.isPrototypeOf(file)) // 构造函数 console.log(file instanceof Array) console.log(Object.prototype.toString.call(file)) //
阅读全文
摘要:let barRoute = { path: '/', component: () => import('../view/basicView'), redirect: '/home', children: [ // 带底部导航 ] } let routes = [ barRoute, { name:
阅读全文
摘要:function MyClassList(classes, dom){ [].push.apply(this, classes) Object.defineProperty(this, "__value__", { enumerable: false, set: function(val){ dom.className = val; } }) } MyClassList....
阅读全文
摘要:FastScan - 用于敏感词过滤的 ahocorasick 算法快速文本搜索JS实现
阅读全文
摘要:if (!Function.prototype.bind) { Function.prototype.bind = function (oThis) { if (typeof this !== "function") { throw new TypeError("Function.prototype.bind - what is trying to be bound...
阅读全文
摘要:今天OA里有个需求,要在一个链接后,增加当前用户的账户密码,再跳转。 打开页面查看源码,发现,这个链接在iframe里,以为能够根据iframe直接find出来 试了试。报错:Uncaught TypeError: parent.triggerMouseupHandle is not a funct
阅读全文
摘要:最近需要一个指定格式的日期字符串。 想看下是不是有类似java日期转换类SimpleDateFormat一样的方法 看了下网上的代码,大部分都会分别去获取日期的年,月,日,时分秒。然后根据所需格式拼接。 觉得不适合做成一个js的工具方法。 后面看到这个方法,觉得不错。 DateToStringUti
阅读全文
摘要:最近需要一个简单的瀑布流效果,所以网上找了一个,修改了部分代码 1、轻量代码,压缩2kb。 2、适用宽度自适应布局。瀑布流列由css控制。(先加入空列,获取宽度,删除空列,根据总宽计算列数。) wall.js 压缩后代码 页面以及样式。 index.html 最终效果 PC端 移动 其他。这里的其他
阅读全文

浙公网安备 33010602011771号