随笔分类 -  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)} 阅读全文
posted @ 2019-05-09 17:14 一叶*秋 阅读(294) 评论(0) 推荐(0)
摘要:///将扁平化之后的数组还原成树 buildTree = (list) => { let dataArray = []; list.forEach(item=>{ if(item._parent_path ''){ dataArray.push(item); } }); return this.da 阅读全文
posted @ 2018-12-25 09:37 一叶*秋 阅读(854) 评论(0) 推荐(0)
摘要:class B { constructor (){ console.log('boonook'); } } let b = new B(); b.constructor B.prototype.constructor // true//// 等同于 //装饰器 阅读全文
posted @ 2018-09-26 17:50 一叶*秋 阅读(164) 评论(0) 推荐(0)
摘要:const _arr = [1, 2, 3, 4, 5, 5, 5, 5];console.log(..._arr);//解构console.log(new Set(_arr));//去重值是唯一的 /// console.log([...new Set(_arr)])//去重值是唯一的 阅读全文
posted @ 2018-09-26 17:11 一叶*秋 阅读(123) 评论(0) 推荐(0)
摘要:使用前提返回的是一个promiss对象 阅读全文
posted @ 2018-09-26 15:51 一叶*秋 阅读(356) 评论(0) 推荐(0)
摘要: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, 阅读全文
posted @ 2018-09-11 15:56 一叶*秋 阅读(571) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-09-11 15:24 一叶*秋 阅读(1582) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/m0_37452696/article/details/78370504 继承特性1 - 实例成员继承 通过extends关键字实现继承 如果子类有构造器, 必须添加super()调用父类构造器 继承后子类实例便可使用父类实例的属性与方法 class An 阅读全文
posted @ 2018-09-07 14:16 一叶*秋 阅读(148) 评论(0) 推荐(0)
摘要:静态方法 静态方法属于类自己,通过类名.方法名调用 注意这里static关键字只能作用于方法,不能作用于属性 class Person { constructor() { Person.total++ || (Person.total = 1); }; // 统计总人口, static getTot 阅读全文
posted @ 2018-09-07 14:08 一叶*秋 阅读(1316) 评论(0) 推荐(0)

博客侧边栏公告广告位招租