Skip to content

Commit 3bd3909

Browse files
committed
fix: Fix disableToolbar props issue.
1 parent f086e36 commit 3bd3909

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const Demo = ()=> (
121121
<CodeLayout
122122
code={<code>{code}</code>}
123123
text={code}
124-
disableTollbar
124+
disableToolbar
125125
>
126126
<div>示例内容</div>
127127
</CodeLayout>

core/src/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ const CodeLayout = forwardRef<HTMLDivElement, CodeLayoutProps>((props, ref) => {
8585
</div>
8686
</div>
8787
)}
88-
{!disableCode && <div className={`${prefixCls}-code ${showCode ? 'w-display' : 'w-hidden'}`}>{code}</div>}
88+
{!disableCode && !disableToolbar && (
89+
<div className={`${prefixCls}-code ${showCode ? 'w-display' : 'w-hidden'}`}>{code}</div>
90+
)}
8991
</div>
9092
);
9193
});

core/src/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
border-radius: 5px;
2222
background-color: var(--color-canvas-subtle);
2323
}
24-
.w-rcpl-preview {
24+
.w-rcpl-preview:not(:last-child) {
2525
border-radius: 5px 5px 0 0;
2626
}
2727
.w-rcpl-code.w-hidden {

0 commit comments

Comments
 (0)