File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
website/src/pages/example Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,19 @@ mdObj.components // => 组件索引对象,从 markdown 索引到的示例转
1919mdObj .codeBlock // => 组件源码索引对象,从 markdown 索引到的示例源码。(需要配置 meta)
2020```
2121
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+
2235``` ts
2336export type CodeBlockData = {
2437 source: string ;
Original file line number Diff line number Diff line change @@ -23,11 +23,12 @@ export function ExamplePage() {
2323 languages : { } ,
2424 } ) ;
2525
26- const [ lang , setLang ] = useState ( '' ) ;
26+ const [ lang ] = useState ( '' ) ;
2727 useEffect ( ( ) => {
2828 const getMd = async ( ) => {
2929 // const result = await import(`@uiw/react-layout/README${lang}.md`);
3030 const result = await import ( `./App${ lang } .md` ) ;
31+ console . log ( result ) ;
3132 if ( result . default ) {
3233 setMdData ( result . default ) ;
3334 }
You can’t perform that action at this time.
0 commit comments