Skip to content

v0.8.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@Atinux Atinux released this 07 Dec 22:48

Feature

  • Add routeChanged event for $nuxt, you can use it like this in your plugins:
if (process.BROWSER_BUILD) {
  // set google-analytics script here...
  // and then:
  window.onNuxtReady((app) => {
    app.$nuxt.$on('routeChanged', (to, from) => {
      ga('set', 'page', to.fullPath)
      ga('send', 'pageview')
    })
  })
}