My old code was
var App = require('./component/App.vue');
var router = new VueRouter();
router.transitionOnLoad = true;
router.map({
'/': {
component: FrontComponent
}
});
router.redirect({
'*': '/'
});
router.start(App, '#app');
After running migration tool my code is
var App = require('./component/App.vue');
var router = new VueRouter({
routes: [
{ path: '*', redirect: '/' },
{ path: '/', component: FrontComponent },
{ path: '/:station', component: BoardComponent },
{ path: '/:station/:url', component: JourneyComponent }
]
});
router.start(App, '#app');
Im getting this Uncaught TypeError: router.start is not a function so I looked through vue router migration but router.start is not defined anywhere.
Then I looked in the docs for router 2.0, but router.start is not defined anywhere, and the getting started is just
const app = new Vue({
router
}).$mount('#app')
But I use a .vue file to generate my app, so I'm a bit lost on what to do
Hi, thanks for filling this issue, can you open this on the migration helper's repo instead? Thanks!
As for your question, simply do:
var App = require('./component/App.vue');
const app = new Vue({
router,
render: h => h(App)
}).$mount('#app')
Most helpful comment
Hi, thanks for filling this issue, can you open this on the migration helper's repo instead? Thanks!
As for your question, simply do: