-
Notifications
You must be signed in to change notification settings - Fork 93
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
Nesting components #149
Comments
@mdings hmm isn't this the intended behavior? As far as i can tell from the code, you're adding an empty object which means, in the last step where you go back to the top most div and click, the I forked your code here https://jsfiddle.net/b8txsqLz/1/ to demonstrate this. The tooltip shows the content of |
Yes, but the items are always pushed to the element itself, hence the stopPropagation method. So the items data for a child component can contain multiple objects that are being flushed when an object is added to the top items array. In any case, what I want to achieve is to be able to build up some sort of navigation tree. So I would like to be able to append an item to the root of the array while keeping the rest of the generated tree intact. Hope that makes sense. |
In this case I can think of two options:
I prefer the second approach, which is why I only tried the second. But I'm sure you can come up with a solution that implements the centralized approach. Hope this helps! |
Ah I see what you're doing there. I don't really understand we you're not needing the $update function though? |
I've got an issue when nesting components. It probably has something to do with the way rendering occurs. Example can be found here: https://jsfiddle.net/dfmkfmyb/
When clicking on the blue div, a new div will be appended to the parent using the same component. This works indefinitely. However when clicking the topmost div after having created a few children within a div, the list re-renders and only keeps one level of children components.
The text was updated successfully, but these errors were encountered: