[Vuejs]-Set event listener programmatically in nativescript-vue

1👍

I resolved what I needed by using the nativescript event handler instead of vue’s event handler interface. https://docs.nativescript.org/core-concepts/events

I was trying to listen to a page event, so my code looks something like this:

const Page = require('tns-core-modules/ui/page').Page

const componentPage = vueComponent.nativeView.page
componentPage.on(Page.navigatedFromEvent, myHandlerMethod)

Leave a comment