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

dumi2 是否支持文档多版本 #1810

Closed
nanianlisao opened this issue Aug 2, 2023 · 1 comment
Closed

dumi2 是否支持文档多版本 #1810

nanianlisao opened this issue Aug 2, 2023 · 1 comment
Labels
question Further information is requested

Comments

@nanianlisao
Copy link
Contributor

Question

dumi2 是否支持文档多版本呢
考虑维护问题,所以还是希望使用约定式路由,本计划是通过 onRouteChange 做路由重定向到对应版本,但是由于 dumi2仅支持二级导航,因此多嵌套一套version路由会导致sideBar异常, 请问有什么好的解决方案吗

Sample Code

import { history } from 'dumi';
export function onRouteChange(router: any) {
  const {
    routes,
    location: { pathname },
  } = router;

  if (pathname.startsWith('/xxx')) {
    history.replace(pathname.replace('/xxx', `/v2/xxx`));
  }
}

@nanianlisao nanianlisao added the question Further information is requested label Aug 2, 2023
@PeachScript
Copy link
Member

Duplicate of #208 (comment)

@PeachScript PeachScript marked this as a duplicate of #208 Aug 2, 2023
@PeachScript PeachScript closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants