Passing ref's content from a child to another VueJS child component

Viewed 27066

I'm learning VueJS and I got a little confused on the ref, $refs lecture. I tried to understand it from vue's documentation, but I didn't get what I want to know.

If for example I have this component:

<user-item ref="details"></user-item>

and I get the data from this component using

this.$refs.details

to use that data in the User parent component, because this user-item is a child for User component.

<div id="User">
  <user-item ref="details"></user-item>
</div>

In the same time I have another component called, let's say Permissions that's child too, for User component:

<div id="User">
   <user-item ref="details"></user-item>
   <permissions></permissions> 
</div>

In this Permissions component I need the same this.$refs.details, but from what I test, like an experiment, doesn't work.

This is just a simple example.

Can someone please tell me how can I do it?

1 Answers
Related