There is a VueJs component embedded in a regular web page. Whenever the component triggers an event, I need the regular web page to react accordingly. Is this achievable?
The Sites.vue component is a single file element placed within the content of the regular web page.
<sites @pmds="handlePmds"></sites>
Occasionally, it dispatches an event using the following code:
this.$emit("pmds", pmds);
On the main webpage, I intend to handle the event in this manner:
function handlePmds(e) {
console.log(e);
}
However, this approach fails because handlePmds
is not recognized as a VueJS function. So how can I capture and respond to that event effectively?