Skip to content

this.$parent.xxx #715

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

Closed
aclowner opened this issue Nov 27, 2020 · 1 comment
Closed

this.$parent.xxx #715

aclowner opened this issue Nov 27, 2020 · 1 comment

Comments

@aclowner
Copy link

vue2: this.$parent.xxx
vue3: How to use the function of parent component?

@skirtles-code
Copy link
Contributor

It should be the same in Vue 3:

https://jsfiddle.net/skirtle/m0ng1cqf/

There was a conversation in #454 about documenting the removal of $parent but it appeared to be a misunderstanding, possibly caused by a bug. $parent still exists and it is documented in the API Reference.

I would note that the use of $parent to call a function is generally discouraged. Ideally you should use events or props instead.

I'm going to close this for now. If I've misunderstood and you believe there's a documentation problem then please provide more information and we can reopen this. If you think you've found a library bug then you'll need to open an issue against the vue-next repository.

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