![](https://img-blog.csdnimg.cn/2019092715111047.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
ES6
丰色木夕
程序员,21世纪中国最伟大的职业之一
展开
-
@babel/plugin-proposal-class-properties 及 属性的赋值与定义的区别
@babel/plugin-proposal-class-propertieshttps://babeljs.io/docs/en/next/babel-plugin-proposal-class-properties.htmlwebpack开启decorator 装饰器https://www.cnblogs.com/m2maomao/p/11411233.htmlERROR in ./src/UiReactComponets/BaseSearchBarUI/index.jsxModule bui原创 2020-08-29 18:00:56 · 6719 阅读 · 0 评论 -
ES6 装饰器及webpack下配置装饰器语法
在一起原创 2020-08-29 17:35:36 · 1680 阅读 · 0 评论 -
call()、apply()、bind()方法的使用
call()、apply()、bind()方法的使用这三个方法尤其不好区分、也容易混淆,网上有很多文章试图解释这三个的区别及用法。有的还举例,用故事说,反而增加了理解的难度,只是想简单、快速、直接在理解这几个方法,但是却得先理解那个故事的含义。 很无语。。。call、apply、bind的作用是改变函数运行时this的指向我去,啥意思?我们看一下面两个对象var name = 'WW'function objA() { name: 'AA', show: function(){ conso原创 2020-08-19 19:46:07 · 294 阅读 · 0 评论 -
ES6 开发报错 object null is not iterable (cannot read property Symbol(Symbol.iterator))
ES6 开发报错 object null is not iterable (cannot read property Symbol(Symbol.iteratorj这样的错又时很难发现是怎么回事,遇到这样的错,要考虑ES6语法中的解构语法是否存在错误常见的解构错误有:// err.1const arr = { name: 'hellow' }const [var1, var2] = arr // 解构错误//err.2const a = nullconst [var1] = a // 解原创 2020-07-06 02:44:38 · 15085 阅读 · 0 评论 -
ES6中实现单例模式
ES6中实现单例模式1、通过构造函数class SingletonApple { constructor(name, creator) { //首次使用构造器实例 if (!SingletonApple.instance) { this.name = name; this.creator = creator; //将this挂载到Sing...原创 2020-04-27 12:11:50 · 896 阅读 · 0 评论 -
jsdoc接口文档生成器
jsdochttps://blog.csdn.net/weixin_34006468/article/details/92717326?depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-3&utm_source=distribute.pc_relevant.none-task-blog-OPENSEAR...原创 2020-04-21 23:53:24 · 1458 阅读 · 1 评论 -
axios实现下载
下载问题let formElement = document.createElement('form'); formElement.style.display = "display:none;"; formElement.method = 'post'; formElement.action = ${apiBasePath}/api/xxxxx/downloadDetailData; f...原创 2020-04-17 08:59:27 · 373 阅读 · 0 评论 -
export与model.export有啥区别
关于export 、export default 的常用方法一个js文件中,最多只能有一个export default,可以同时有多个export看一下下面的例子1、只有一个export时,应使用export default,而不能使用使用exportclass myComp { ...}export default myComp对应的import为 import MyComp ...原创 2020-03-30 23:25:21 · 2798 阅读 · 0 评论 -
ES5及ES6的自定义错误类型实现
关于JS中自定义错误类型的一些建议在开发前端项目,调试过程中,经常能看到一些抛出异常的错误提示。这些错误提示的抛出,意味着代码运行的中止。为什么我们需要自定义自己的错误类型呢...原创 2020-03-23 09:59:33 · 922 阅读 · 0 评论 -
ES6的数组的一些常用方法
every() 与 some()every 一假即假some 一真即真如下:const arr = [ {name:"a",val:false}, {name:"b",val:true}, {name:"c",val:false},];const resultA= arr.every(function(item){ return item.val})...原创 2020-02-29 15:11:31 · 247 阅读 · 0 评论 -
ES5与ES6之创建对象
ES5及ES6写对象的对比经常会遇到需要在js 写 ES6 写对象,写了个实例供大家参考ES5创建对象// 类的基本写法function Person(name, sex) { var self = this; this._name = name; // 外部可见的成员变量 this._sex = sex; var no = Person.population; // 静态变量的...原创 2019-11-25 15:56:53 · 299 阅读 · 0 评论 -
Promise对象同步实现
多个Promise 实现同步的方法示例let pro1 = new Promise((resolve, reject) => { setTimeout(() => { resolve('success') },1000)})let p2 = new Promise((resolve, reject) => { setTimeout(() => ...原创 2019-11-04 15:25:12 · 869 阅读 · 0 评论