Hi!
How to call app.methods Function in other page(@click) ??
var app = new Framework7({
methods: {
mainFunc(e){
}
}
});
Other Page
<button @click=“app.methods.mainFunc”>Trigger mainFunc
Hi!
How to call app.methods Function in other page(@click) ??
var app = new Framework7({
methods: {
mainFunc(e){
}
}
});
Other Page
<button @click=“app.methods.mainFunc”>Trigger mainFunc
There are many ways you could do that (depending on the use-case):
Either put the function into $root and then use it from there this.$root.mainFunc()
,
or register your other page/component in $root (e.g. from $root.otherpage = this) and then use the function like so: this.$root.otherpage.mainFunc()
…
Or send an event to the other page and let it call the function for you…