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

$parent of a child component defined on a slot, reference to itself #793

Closed
tonimc opened this issue Jul 3, 2018 · 2 comments · Fixed by #813
Closed

$parent of a child component defined on a slot, reference to itself #793

tonimc opened this issue Jul 3, 2018 · 2 comments · Fixed by #813
Labels

Comments

@tonimc
Copy link

tonimc commented Jul 3, 2018

Version

1.0.0-beta.20

Reproduction link

https://codesandbox.io/s/wqo716rm55

Steps to reproduce

Run the test written on sandbox

What is expected?

It should work as works on the browser so this.$parent should return the parent of the component and not itself.

What is actually happening?

I have a scenario similar to what I reproduce in the sandbox. I have a few components that are inserted on the default slot of a "wrapper" component, each of these components are registered on the parent when are mounted using a method on the parent this.$parent.register.
All work on the browser but when I tried to test the this.$parent of the child component refers to itself and the test fails because it doesn't find the register method.


For example If I change this.$parent by this.$parent.$parent all works.

@tonimc tonimc changed the title $parent of a child component defined on a slot reference to itself $parent of a child component defined on a slot, reference to itself Jul 3, 2018
@eddyerburgh eddyerburgh added the bug label Jul 4, 2018
@38elements
Copy link
Contributor

This is a nice issue.

@tonimc
Copy link
Author

tonimc commented Jul 26, 2018

@eddyerburgh @38elements thanks, good work!!

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