We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vue] 在vue中使用this应该注意哪些问题?
The text was updated successfully, but these errors were encountered:
vue中使用匿名函数,会出现this指针改变。 解决方法 1.使用箭头函数 2.定义变量绑定this至vue对象
Sorry, something went wrong.
vue 的data避免使用箭头函数
vue中methods中函数尽量不要使用箭头函数,会改变this指向,在vue-cli构建的项目中this会为undefined
生命周期的钩子函数不能使用箭头函数,否者this不能指向vue实例
凡是vue里你写的函数中this能拿到当前组件实例的地方,都是vue在内部通过call改绑到vm实例的,但你换成箭头函数,它里面的this是无法改绑的,只继承上级的this
No branches or pull requests
[vue] 在vue中使用this应该注意哪些问题?
The text was updated successfully, but these errors were encountered: