简体   繁体   English

这是在 sfc vue 方法中未定义的

[英]this is undefined inside sfc vue method

My problem is the following: while hovering over the variable while debugging inside the chrome devtools this is what I´m getting:我的问题如下:在 chrome devtools 中调试时将鼠标悬停在变量上,这就是我得到的:

开发工具图片

In the devtools console:在开发工具控制台中: 控制台打印

Anyone has any idea why this would be happening?任何人都知道为什么会发生这种情况? This is really anoying since makes the debugging process much more troublesome?!!这真的很烦人,因为使调试过程更加麻烦?! Any solution?有什么解决办法吗?

You should be able to access variable _thisN where N is 1 or 2, 3... in the console instead, which is provided by the Babel transpiler.您应该能够在控制台中访问变量_thisN ,其中N是 1 或 2, 3... ,这是由 Babel 转译器提供的。

I think this is related to an optimization technique Chrome uses to clean up variables outside of scope.我认为这与 Chrome 用于清理 scope 之外的变量的优化技术有关。 See Why does Chrome debugger think closed local variable is undefined?请参阅为什么 Chrome 调试器认为封闭的局部变量未定义? for further explanation.进一步解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM