Closed
Description
What problem does this feature solve?
I'm writing a Vue.js app using vue-router. I mistyped the 'component' field for route, like that:
const router = new VueRouter({
mode: 'history',
routes: [
// some other routes
{ path: '/dashboard', compoment: DashboardComponent },
// more components
]
});
The result is nothing is rendered on this route. And I've spent 2 hours debugging it because there's no error/warning if the component field is not set.
My suggestion is to throw an error (or at least put a warning to console.log()
), that way it'd be more clear that the user didn't provide a component for render and that's why nothing is rendered.
What does the proposed API look like?
No API changes, just add the error/warning if the component is not set.
Metadata
Metadata
Assignees
Labels
No labels