随笔分类 - ECMA6
javascript2015
摘要:function aa(){ return new Promise(function(resolve){ if (format 'csv') resolve('aa') else reject('bb') })}aa().then(res=>{ console.log('aaa res',res)}
阅读全文
摘要:///将扁平化之后的数组还原成树 buildTree = (list) => { let dataArray = []; list.forEach(item=>{ if(item._parent_path ''){ dataArray.push(item); } }); return this.da
阅读全文
摘要:class B { constructor (){ console.log('boonook'); } } let b = new B(); b.constructor B.prototype.constructor // true//// 等同于 //装饰器
阅读全文
摘要:const _arr = [1, 2, 3, 4, 5, 5, 5, 5];console.log(..._arr);//解构console.log(new Set(_arr));//去重值是唯一的 /// console.log([...new Set(_arr)])//去重值是唯一的
阅读全文
摘要:getIdss(node, id, path){ if (!path) { path = [] } if (node.id id) { return path } path.push(node); if (node.item.some(child => this.getIdss(child, id,
阅读全文
摘要:digui(){ this.$Request.get('api/groups/tree', {}).then(res => { if (res && res.code 0) { if (Array.isArray(res.data)) { this.treeData = res.data.map(o
阅读全文
摘要:https://blog.csdn.net/m0_37452696/article/details/78370504 继承特性1 - 实例成员继承 通过extends关键字实现继承 如果子类有构造器, 必须添加super()调用父类构造器 继承后子类实例便可使用父类实例的属性与方法 class An
阅读全文
摘要:静态方法 静态方法属于类自己,通过类名.方法名调用 注意这里static关键字只能作用于方法,不能作用于属性 class Person { constructor() { Person.total++ || (Person.total = 1); }; // 统计总人口, static getTot
阅读全文

浙公网安备 33010602011771号