title: vue-router 2, how to fetch routes via ajax?
body: <p>How do I create the routes array dynamically, after fetching it via ajax?</p>
  
  <p>Is there a way to add/push new routes to the router after it has been initialized?</p>
  
  <p>This doesn't work:</p>
  
  <pre><code>new Vue({
    el: '#app',
    template: '&lt;App/&gt;',
    data: {
      content: []
    },
    created: function () {
      this.$http.get('dummyjsondatafornow').then((response) =&gt; {
  
        // this doesn't work when creating the VueRouter() outside the Vue instance, as in the docs.
        // this.$router.options.routes.push({ path: '/about', component: About })
  
        let routes = [
          { path: '/about', component: About }
        ]
  
        // this doesn't work either
        this.router = new VueRouter({
          routes: routes
        })
      })
    },
    // router: router,
    components: { App }
  })
  </code></pre>