-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
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
onBeforeXXX 生命周期存在一个默认参数undefined #10863
Comments
Does this have any real impact on usage? |
Yes, for the lifecycle, there is encapsulation. When external hook functions are called internally, the internal context is passed to the incoming hook function, which can result in the inability to obtain the corresponding context on the correct path |
The this instance in the above figure is not a Vue instance but a class instance, and the execution of externally passed hooks depends on the context of the this instance |
Co-authored-by: Haoqun Jiang <[email protected]> Close #10863
…#10869) Co-authored-by: Haoqun Jiang <[email protected]> Close vuejs#10863
Vue version
3.4.24
Link to minimal reproduction
http://
Steps to reproduce
onBeforeXXX 钩子函数内 hook 收集剩余参数 ...args 存在一个默认的 undefined 参数
例:
What is expected?
onBeforeMount 是无参的 args 应该是个空数组才对
What is actually happening?
onBeforeXXX 钩子函数存在 一个 undefined参数 args=[undefined]
System Info
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: