- 博客(2)
- 收藏
- 关注
原创 在React+Typescript的项目中,安装配置prettier和eslint
安装配置prettier 步骤一:使用npm包管理工具安装prettier npm i prettier 步骤二:在项目根目录下,创建一个.prettierrc文件,文件内容为 { "singleQuotes": true } 步骤三:在package.json文件中添加script 本文在2021年8月撰写,不同版本的eslint,在安装配置中可能有细微差别,建议带版本号安装。 ...
2021-08-19 11:16:08 759
原创 理解this
this的使用场景 在function里使用this this是function的一个隐形参数 strict mode下,this指向undefined sloppy mode下,this指向global object 在arrow function里使用this this不是arrow function的一个参数,向arrow function外取值(shadow) 在constructor里使用this 可以使用new关键字调用constructor;new关键字会创建一个.
2021-08-16 10:03:39 87
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人