After setting up a project with vue-cli
using the webpack
template, I decided to incorporate a reusable bootstrap modal dialog in the App
component. To achieve this, I created a method called showMessage
in the App
component that handles displaying the modal.
With the requirement of being able to access this method from any component in mind, I started exploring different ways to call it. One approach I came across was shown below:
this.$root.$children[0].showMessage('Message', `An email will be sent to ${this.form.email}`)