File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @kne/modules-dev" ,
3- "version" : " 2.1.12 " ,
4- "description" : " 用于辅助在项目内启动一个规范化组件开发的环境. " ,
3+ "version" : " 2.1.13 " ,
4+ "description" : " 用于辅助在项目内启动一个规范化组件开发的环境" ,
55 "publishConfig" : {
66 "access" : " public" ,
77 "source" : " src/index.js" ,
Original file line number Diff line number Diff line change @@ -50,15 +50,17 @@ const ExampleRoutes = ({
5050 } ) => {
5151 const componentsPath = paths . find ( ( item ) => item . key === 'components' ) ;
5252 const componentsBaseUrl = ensureSlash ( get ( componentsPath , 'path' , '/' ) , true ) ;
53+ const baseUrlPrefix = new RegExp ( `^${ ensureSlash ( baseUrl , true ) } ` ) ;
54+ const componentsRoutePath = ensureSlash ( componentsBaseUrl . replace ( baseUrlPrefix , '' ) ) ;
5355 return < Routes >
5456 < Route element = { < MainLayout paths = { paths } preset = { preset } themeToken = { themeToken } { ...props } /> } >
55- { componentsPath &&
56- < Route path = { componentsBaseUrl } element = { < ModulesIsEmpty baseUrl = { componentsBaseUrl } readme = { readme } /> } >
57- < Route path = ":id"
58- element = { < Example baseUrl = { componentsBaseUrl } readme = { readme } pageProps = { pageProps } /> } />
59- < Route path = ":id/*"
60- element = { < Example baseUrl = { componentsBaseUrl } readme = { readme } pageProps = { pageProps } /> } />
61- </ Route > }
57+ { componentsPath && < Route path = { componentsRoutePath }
58+ element = { < ModulesIsEmpty baseUrl = { componentsBaseUrl } readme = { readme } /> } >
59+ < Route path = ":id"
60+ element = { < Example baseUrl = { componentsBaseUrl } readme = { readme } pageProps = { pageProps } /> } />
61+ < Route path = ":id/*"
62+ element = { < Example baseUrl = { componentsBaseUrl } readme = { readme } pageProps = { pageProps } /> } />
63+ </ Route > }
6264 </ Route >
6365 < Route path = '*' element = { children } />
6466 </ Routes >
You can’t perform that action at this time.
0 commit comments