In the scenario where I have a basic Vue plugin that does not contain any components, but simply provides some methods to the user:
export default {
install(Vue, options) {
// Unrelated tasks go here.
}
Vue.prototype.$foo = () => {
// Trigger an event at this point.
}
}
Whenever the user invokes the foo
method, I want to trigger an event for them to respond to. However, I am unsure if there is a specific Vue method to achieve this or if I should resort to using a CustomEvent
.