Static GitHub Issues

[2460] How use VueRouter instance in the plugin?

prev: How to achieve the following routing
next: nuxt generate is OK,however refresh the dynamic routes, it reminder this.$options is undefined

I try use vue-analytics. In plugin i need VueRouter instance like this:

import Vue from 'vue'
import VueRouter from 'vue-router'
import VueAnalytics from 'vue-analytics'

const router = new VueRouter({
  router: // your routes
})

Vue.use(VueAnalytics, {
  id: 'UA-XXX-X',
  router
})

Where can I import a router based on the folder structure?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2135">#c2135</a>)</em></sub></div>