1.0.1 • Published 4 years ago

umi-plugin-pro-routes v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

umi-plugin-pro-routes

NPM version NPM downloads

WARNING: *不同版本的umi有不同路由生成模板, 请使用umi@2.9.6*

英文 | 中文

How it works?

Modal page根据react-router新特性, umi-plugin-pro-routes 会异步的生成新的新的router.js, 然后覆盖原先的.

ScreenShots

pro-routes

Usage

查看example

Configure in .umirc.js,

export default {
  plugins: [
    ['umi-plugin-pro-routes', { enable: true }],
  ],
}

Configure in any page,

/**
* modalKey: {string} // like PageOne
*/

Dipatch with router

import { router } from 'umi'

<Button
  onClick={() => {
    router.push({
      pathname: '/modal-page/pageone',
      search: 'modalKey=PageOne',
    })
  }}
>
  弹窗
</Button>

Supper simple

Options

{
  enable?: boolean
}

LICENSE

MIT