摘要: class Event { constructor() { this.eventObj = {}; } $on(eventName, fn) { if (!this.eventObj[eventName]) { this.eventObj[eventName] = []; } this.eventO 阅读全文
posted @ 2021-03-30 18:58 ~~Distance 阅读(97) 评论(0) 推荐(0) 编辑
摘要: bind bind用法fn.bind(thisobj,参数1,参数2,。。。) this.a = 1; var mode = { a: 10, getA: function (...rest) { return rest.reduce((pre, value) => { console.log(pr 阅读全文
posted @ 2021-03-30 18:39 ~~Distance 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 判断数组的类型为数组,而不是Object arr.constructor == Array instanceof arr == Array Array.isArray() reduce 第一个参数是function,第二个参数可以是数组,可以是数字, reduce(function(only,ite 阅读全文
posted @ 2021-03-11 11:25 ~~Distance 阅读(89) 评论(0) 推荐(0) 编辑
摘要: import Form from "form-data/lib/form_data" //在electron上传文件中添加node form-data模块 const fs = require('fs'); const path = require('path'); const archiver = 阅读全文
posted @ 2021-01-22 11:32 ~~Distance 阅读(5134) 评论(0) 推荐(0) 编辑
摘要: 生成二维码 阅读全文
posted @ 2020-03-14 17:11 ~~Distance 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 百度云播放器 引入cyberplayer.js 创建播放 播放5分钟后暂停 重新播放 腾讯云播放器 重新播放 侦听视频播放结束 侦听视频播放暂停 音频audio 播放音频 ` 重新播放 阅读全文
posted @ 2020-03-14 16:12 ~~Distance 阅读(2564) 评论(0) 推荐(0) 编辑
摘要: 报regeneratorRuntime is not defined的错 在.babelrc文件中加入 阅读全文
posted @ 2020-01-06 16:09 ~~Distance 阅读(117) 评论(0) 推荐(0) 编辑
摘要: webpack配置 插件 loader:模块的转换,凡是需要将浏览器不识别的文件转换为浏览器识别的文件的配置项都需要在module中进行配置; 阅读全文
posted @ 2020-01-02 20:35 ~~Distance 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 文本不能选中 -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; 固定文本多少后...显示 -webkit-line-clamp: 2; text-overflow: 阅读全文
posted @ 2019-12-24 15:09 ~~Distance 阅读(271) 评论(0) 推荐(0) 编辑
摘要: nextTick 在下次 DOM 更新循环结束之后执行延迟回调。在修改数据之后立即使用这个方法,获取更新后的 DOM。 在项目中遇到做横向滚动,并且通过首页传进来的值找到是通过哪一条进来的,并且将那一条展示在手机屏幕的可视区域, css代码如下 通过上一级页面传进来的值去请求接口之后,找到当前定位的 阅读全文
posted @ 2019-12-24 15:04 ~~Distance 阅读(588) 评论(0) 推荐(0) 编辑