I have an app that is mounted within the page of a preexisting website. In order to initialize the app i have a button within my Vue app to toggle/start the actual Vue logic.
It is all very straight forward, a button appears on the page, click it, the app logic and methods all come to life.
<template>
<button @click.prevent="toggle">Click me</button>
</template>
<script>
export default {
computed: {
isBurgerActive() {
return this.$store.getters.getIsNavOpen;
}
},
methods: {
toggle() { <----- CALL THIS METHOD OUTSIDE OF VUE
this.$store.dispatch('toggleNav');
this.$store.dispatch('getProduct');
}
}
}
</script>
What i want to do is initialize this app with a button that is not within the Vue app. Essentially saying on click of button outside of the Vue app, initialize the toggle() method and start the whole process off.
Is that possible?