0
votes

Actually, I work in web app with vuejs as frontend framework.

in a particular situation, I want to communicate two separate components.

I know there are many ways to do that, especially with vuex that can help us to create a maintainable application.

in my case, i found we can manipulate data between components by bus events and with mixins (by $emit and $on event) also.

for that, i want to know :

  1. how bus events and mixin work exactly ?
  2. what is the difference between them ?
1

1 Answers

1
votes

A mixin is a partial component spec. You include mixins in a component to compose functionality.

An event bus is a communication channel on which events can be emitted and listened for. Every Vue instance is an event bus.