vuejs/vue-router

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

クローズ

#2,038 opened on 2018/01/31

 (9 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (5,092 件のフォーク)batch import
contribution welcomefeature requestgood first issue

Repository metrics

Stars
 (19,015 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド