File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { SP_ROUTE_PREFIX } from '@/constants' ;
2
- import { useSiteData } from 'dumi' ;
2
+ import { useAppData , useSiteData } from 'dumi' ;
3
3
import Container from 'dumi/theme/builtins/Container' ;
4
4
import Previewer from 'dumi/theme/builtins/Previewer' ;
5
5
import React , { createElement , type FC , type ReactNode } from 'react' ;
@@ -38,6 +38,7 @@ const DemoErrorBoundary: FC<{ children: ReactNode }> = (props) => (
38
38
39
39
export const DumiDemo : FC < IDumiDemoProps > = ( props ) => {
40
40
const { demos } = useSiteData ( ) ;
41
+ const { basename } = useAppData ( ) ;
41
42
const { component, asset } = demos [ props . demo . id ] ;
42
43
43
44
if ( props . demo . inline ) {
@@ -50,7 +51,7 @@ export const DumiDemo: FC<IDumiDemoProps> = (props) => {
50
51
demoUrl = {
51
52
// allow user override demoUrl by frontmatter
52
53
props . previewerProps . demoUrl ||
53
- `/ ${ SP_ROUTE_PREFIX } demos/${ props . demo . id } `
54
+ `${ basename } ${ SP_ROUTE_PREFIX } demos/${ props . demo . id } `
54
55
}
55
56
{ ...props . previewerProps }
56
57
>
You can’t perform that action at this time.
0 commit comments