0π
β
In my opinion, you canβt right now directly call a child function of a brother. So, with your code, you canβt directly call a function of a component A, from a component B which is the brother of the A one.
But, you can do that with the grandparent component.
So, when the ManagmentArtifact.vue
component need to call refreshArtifact
function, you can emit an event. The TeamManagment.vue
listen that event, and then pass use ref
of TeamPlatform.vue component
to call the function.
ManagmentArtifact.vue
: this.$emit('callRefresh')
TeamManagment.vue
: <ManagmentArtifact @callRefresh='refreshArtifact' />
<TeamPlatform ref='team' />
methods: { refreshArtifact(){ this.$ref.team.refreshArtifact() } }
You can read the doc here.
Source:stackexchange.com