Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react router v5 使用history 模块,控制路由 #27

Open
aototo opened this issue Aug 27, 2019 · 0 comments
Open

react router v5 使用history 模块,控制路由 #27

aototo opened this issue Aug 27, 2019 · 0 comments

Comments

@aototo
Copy link
Owner

aototo commented Aug 27, 2019

react router 核心 就是使用 history 模块。

so..

可以在 其他需要访问控制路由的地方

var history = require('history');
// 如果你的路由是: example/some/path 这样真实的 URL

import { createBrowserHistory } from 'history'
const history = createBrowserHistory()

// 如果你的路由是 :example/#/some/path

import { createHashHistory } from 'history'
const history = createHashHistory()


history.push(example/some/path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant