vuejs/vue-router

Throw exception or provide info message when route's component is null

Chiusa

#2038 aperta il 31 gen 2018

 (9 commenti) (0 reazioni) (0 assegnatari)JavaScript (5092 fork)batch import
contribution welcomefeature requestgood first issue

Metriche repository

Star
 (19.015 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

What problem does this feature solve?

Currently, route's component can be null and it give no information and error. Provide information or raising error can help users to catch they have some import issues when they use

import * as components from './components'

export default [
  {
    path: '/accounts',
    component: components.AccountsListView,
    name: 'accountsListView'
  },
  {
    path: '/accounts/create',
    component: components.CreateEditAccounts,
    name: 'createAccounts'
  }
]

So if components.CreateEditAccounts is null, they will know what went wrong easier.

What does the proposed API look like?

Raise error when component is null or log info message.

Guida contributor