0

I have two vue files in different paths like views/core/AppBar.vue and view/entity/edit.vue.I want to call or refresh Appbar.vue when a particular event happens.

I don't know how to call or refresh other component and which approach is better?

Thanks in advance

1

1 Answer 1

1

If these two components are in a parent-child relation then you can use $emit from a child component to a parent one and use $refs. to call a child component method directly from a parent component.

If these components are not related closely then you should use the event bus pattern (see examles with creating new Vue()) or if you wish shared data for these components then use a vuex store to store all shared objects.

Sign up to request clarification or add additional context in comments.

1 Comment

"Bus" it the best solution for non component relationships and its also a simplest way. i found a link refer this : medium.com/@kashifazmi94/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.