loading...

Handle page unload event in nativescript-vue

meyt profile image Meyti ・1 min read
import { Page } from 'tns-core-modules/ui/page'
export default {
  mounted () {
    this.nativeView.page.on(Page.navigatingFromEvent, this.pageUnload)
  },
  beforeDestory () {
    this.nativeView.page.off(Page.navigatingFromEvent, this.pageUnload)
  },
  methods: {
    pageUnload () {
      console.log('page unload')
    }
  }
}

Discussion

markdown guide