[Vuejs]-Vue router not working with single file components with MeteorJS

0👍

Well, looks like the problem was in my tsconfig. esModuleInterop should be true, but allowSyntheticDefaultImports should be false.

Next, mounting the component directly doesn’t work – should have realized that. This worked:

var myApp = new Vue({
    el: "#app",
    render: h => h(App),
    router: new VueRouter({
        routes: routes
    })
})

The thing is I still have the <router-view> in the App component. I just moved the actual router to the parent Vue instance.

Leave a comment