Skip to content
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

Why use the parent instance $createElemen method #14

Closed
HcySunYang opened this issue Jan 3, 2018 · 2 comments
Closed

Why use the parent instance $createElemen method #14

HcySunYang opened this issue Jan 3, 2018 · 2 comments

Comments

@HcySunYang
Copy link

Why do you override the $createElemen method of the current instance via mixins as the $createElemen method of the parent instance?

this.$createElement = this.$parent.$createElement
@jackmellis
Copy link
Owner

It was a while ago now but it had something to do with slots being called with the incorrect context.

See this comment for the point at which we started using this approach:

vuejs/vue#6201 (comment)

@HcySunYang
Copy link
Author

@jackmellis Thanks for your reply, I did some research and I have understood the reason for doing so. I wrote a blog to explain HOC, but it is Chinese:http://hcysun.me/2018/01/05/%E6%8E%A2%E7%B4%A2Vue%E9%AB%98%E9%98%B6%E7%BB%84%E4%BB%B6/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants