@@ -34,6 +34,9 @@ const getBooleanValue = (param, field, defaultValue) => {
3434} ;
3535
3636const Preview = ( { path, ...mdData } ) => {
37+ const Preview = CodeLayout . Preview ;
38+ const Code = CodeLayout . Code ;
39+ const Toolbar = CodeLayout . Toolbar ;
3740 const $dom = useRef ( null ) ;
3841 return (
3942 < Wrapper ref = { $dom } >
@@ -65,17 +68,15 @@ const Preview = ({ path, ...mdData }) => {
6568 return (
6669 < CodeLayout
6770 disableCheckered = { getBooleanValue ( param , 'disableCheckered' , true ) }
68- disableToolbar = { getBooleanValue ( param , 'disableToolbar' , false ) }
69- disableCode = { getBooleanValue ( param , 'disableCode' , false ) }
70- disablePreview = { getBooleanValue ( param , 'disablePreview' , false ) }
7171 bordered = { getBooleanValue ( param , 'bordered' , true ) }
72- copied = { getBooleanValue ( param , 'copied' , true ) }
73- background = { param . background }
74- toolbar = { param . title || '示例' }
75- code = { < code { ...rest } /> }
76- text = { code }
7772 >
78- < Child />
73+ < Preview >
74+ < Child />
75+ </ Preview >
76+ < Toolbar text = { code } copied = { getBooleanValue ( param , 'copied' , true ) } >
77+ { param . title || '示例' }
78+ </ Toolbar >
79+ < Code > { code } </ Code >
7980 </ CodeLayout >
8081 ) ;
8182 }
0 commit comments