使用uniapp运行到小程序后,方法里为什么会自动生成var _this = this?

微信问答 文章 2021-12-06 17:20 504 0 全屏看文

AI助手支持GPT4.0

使用uniapp运行到小程序后,方法里为什么会自动生成var _this = this?Why is var _this = this automatically generated in the method after running into a small program with uniapp?

使用uniapp运行到小程序后,方法里为什么会自动生成var _this = this?

uniapp开发在hbuilderX上运行到小程序后,方法里自动生成var _this = this;导致自己申明的var that = this不能使用,值取不出来

After the uniapp development runs into the applet on hbuilderx, VaR is automatically generated in the method_ this = this; As a result, the declared var that = this cannot be used and the value cannot be taken out

鍥炵瓟锛�

中式小面包:

没看懂你这that声明了有什么用,直接用this不行?var _this = this这行代码看着也不影响你的

末末:that是我自己申明的,var _this = this是自动生成的,这个本来就不该自动生成,主要原因就在这,之前都好着呢,今天就自动生成了
末末:这是原始的代码,主要就是生成的影响了自己写的
brave:

请移步uni-app官方社区

微喵网络:

请移步uni-app官方社区

-EOF-

AI助手支持GPT4.0