Skip to content

Commit 10c0568

Browse files
committed
fix: 修复文档代码提示
1 parent 71ccf9f commit 10c0568

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

website/src/component/Preview/index.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ const getBooleanValue = (param, field, defaultValue) => {
3434
};
3535

3636
const 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

Comments
 (0)