报错原因:怕全局 “this” 与局部变量发生混叠。
解决:按照 eslint 官方给出的解决方式在 .eslintrc.js 文件中备注 this 可用的局部变量名称
| { | |
| '@typescript-eslint/no-this-alias': [ | |
|       'error', | |
|       { | |
| allowDestructuring: false, // Disallow `const { props, state } = this`; true by default | |
| allowedNames: ['that', 'self', '_this'], // Allow `const self = this`; `[]` by default | |
| }, | |
| ], | |
| } | 
修改完成后要修改对应文件内局部 this 变量名称即可
