File tree 2 files changed +15
-1
lines changed
website/src/pages/example
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,19 @@ mdObj.components // => 组件索引对象,从 markdown 索引到的示例转
19
19
mdObj .codeBlock // => 组件源码索引对象,从 markdown 索引到的示例源码。(需要配置 meta)
20
20
```
21
21
22
+ ``` js
23
+ {
24
+ codeBlock: {
25
+ 17 : ' import React from ...' ,
26
+ 77 : ' import React from ...' ,
27
+ base23: ' import React from ...'
28
+ },
29
+ components: { 17 : ƒ, 77 : ƒ, base23: ƒ },
30
+ languages: { 17 : ' jsx' , 77 : ' jsx' , base23: ' jsx' },
31
+ source: " # Alert 确认对话框...."
32
+ }
33
+ ```
34
+
22
35
``` ts
23
36
export type CodeBlockData = {
24
37
source: string ;
Original file line number Diff line number Diff line change @@ -23,11 +23,12 @@ export function ExamplePage() {
23
23
languages : { } ,
24
24
} ) ;
25
25
26
- const [ lang , setLang ] = useState ( '' ) ;
26
+ const [ lang ] = useState ( '' ) ;
27
27
useEffect ( ( ) => {
28
28
const getMd = async ( ) => {
29
29
// const result = await import(`@uiw/react-layout/README${lang}.md`);
30
30
const result = await import ( `./App${ lang } .md` ) ;
31
+ console . log ( result ) ;
31
32
if ( result . default ) {
32
33
setMdData ( result . default ) ;
33
34
}
You can’t perform that action at this time.
0 commit comments