@@ -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 } >
@@ -68,19 +71,15 @@ const Preview = ({ path, ...mdData }) => {
6871 return (
6972 < CodeLayout
7073 disableCheckered = { getBooleanValue ( param , 'disableCheckered' , true ) }
71- disableToolbar = { getBooleanValue ( param , 'disableToolbar' , false ) }
72- disableCode = { getBooleanValue ( param , 'disableCode' , false ) }
73- disablePreview = { getBooleanValue ( param , 'disablePreview' , false ) }
7474 bordered = { getBooleanValue ( param , 'bordered' , true ) }
75- copied = { getBooleanValue ( param , 'copied' , true ) }
76- background = { param . background }
77- toolbar = { param . title || '示例' }
78- codeProps = { { style : { padding : 0 } } }
79- style = { { padding : 0 } }
80- code = { < pre { ...props } /> }
81- text = { code }
8275 >
83- < Child />
76+ < Preview >
77+ < Child />
78+ </ Preview >
79+ < Toolbar text = { code } copied = { getBooleanValue ( param , 'copied' , true ) } >
80+ { param . title || '示例' }
81+ </ Toolbar >
82+ < Code > { code } </ Code >
8483 </ CodeLayout >
8584 ) ;
8685 }
0 commit comments