I've been working with a custom element called <ts-app>
that I created using vue 3.
The emitted event is functioning correctly, but I'm having trouble figuring out how to call a method from vanilla JavaScript.
customElements.whenDefined("ts-app").then((app) => {
const el = document.querySelector("ts-app");
// I want to call open inside webcomponent here
// tried el.open(), el.shadowRoot.open() both returns open is not defined
el.addEventListener("updated", function (e) {
//this is working fine
console.log(e);
});
});
Within the component, my code looks like this:
methods: {
open() {
console.log('Open Called')
},
}