Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

Latest commit

 

History

History
76 lines (54 loc) · 1.41 KB

README.md

File metadata and controls

76 lines (54 loc) · 1.41 KB

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