I'm working on CreateEntryStepper.vue where I have a button that needs to call a function in CreateEntryStepperImageUpload.vue when pressed.
I understand that event busses need to be used, but I am unsure about what exactly needs to be passed and how to properly set them up.
In bus.js file, the code currently looks like this:
import Vue from "vue";
export const bus = new Vue();
Within CreateEntryStepper.vue, I'm not certain which event to emit:
import { bus } from "@/components/wizard/bus.js";
async submitEntry() {
this.$Progress.start();
bus.$emit();
For CreateEntryStepperImageUpload.vue (where saveImage is the method I want to call), I'm not sure of the correct placement:
import { bus } from "@/components/wizard/bus.js";
And where should this go?
bus.$on()
async saveImage() {
My main question now is, what do I emit and how can I ensure that saveImage is triggered when the button is pressed?