dva/dynamic

1. Installation:

yarn add dva

2. Introduce:

import dynamic from 'dva/dynamic';

* dva routing jump
* dynamic(app, model, component )
* The first parameter is the mounted object, which is the instance to which you want to mount the router.
* The second parameter is the model required by this router.
* The third parameter is the component of this router.

3. Examples:

const routerConfig = {
  '/': {
    component: dynamicWrapper(app, ['user', 'login'], () => import('../layouts/BasicLayout')),
  },
  '/dashboard/analysis': {
    component: dynamicWrapper(app, ['chart'], () => import('../routes/Dashboard/Analysis')),
  },
}

.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325317928&siteId=291194637