Is there a way to call the clicked
method on app2
from within ComponentA
? Let's explore how this can be achieved in the provided example.
const app = Vue.createApp({});
app.component('ComponentA', {
template: `<button @click="clicked" class='btn'>Click</button>`
});
const app2 = Vue.createApp({
methods: {
clicked() {
this.clickCount += 1;
}
},
render() {
return Vue.h(app.component('ComponentA'), options);
}
}).mount("#App");