A lot of people use the Global Event Bus pattern in Vue:
https://alligator.io/vuejs/global-event-bus/
An example of that page which sets up an event listener has this example:
EventBus.$on('i-got-clicked', clickCount => {
console.log(`Oh, that's nice. It's gotten ${clickCount} clicks! :)`)
});
This is an event you could set up before the DOM template has finished rendering for this particular component. If you would wait on the DOM template to finish here you might miss a click. You simply want to do this as soon as possible.
Just like when your component fires an AJAX request, you don't necessarily always have to wait for the DOM to have finished rendering your component. A lot of times you can fire the request straight away. So why wouldn't you want to shave off some time and fire the AJAX request straight away?
Anything that is in your mounted
hook and does not need the DOM, can be moved into a created
hook so it will be executed sooner in your Vue lifecycle.