Skip to content

Commit 31e7e50

Browse files
committed
🐛 fix: corrigir exibição do CodePlayground com código e saída
- Alterar autorun padrão para true para executar código automaticamente - Aumentar altura padrão de 300px para 400px para melhor visualização - Adicionar resizablePanels para permitir ajuste de layout pelo usuário - Adicionar editorWidthPercentage: 50 para distribuição equilibrada - Adicionar autoReload: true para atualização automática - Corrigir showConsoleButton para seguir o valor de showConsole Estas mudanças garantem que o código e a saída sejam exibidos corretamente, resolvendo o problema onde apenas o cabeçalho estático era mostrado.
1 parent cfe35ff commit 31e7e50

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/components/CodePlayground.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import { useColorMode } from '@docusaurus/theme-common';
1515
* @param {string} props.title - Título do exemplo (opcional)
1616
* @param {boolean} props.showLineNumbers - Mostrar números de linha (padrão: true)
1717
* @param {boolean} props.showConsole - Mostrar console (padrão: true)
18-
* @param {boolean} props.autorun - Executar automaticamente (padrão: false)
19-
* @param {number} props.height - Altura do editor (padrão: 300)
18+
* @param {boolean} props.autorun - Executar automaticamente (padrão: true)
19+
* @param {number} props.height - Altura do editor (padrão: 400)
2020
*/
2121
export default function CodePlayground({
2222
code,
@@ -25,8 +25,8 @@ export default function CodePlayground({
2525
title = "Exemplo de Código",
2626
showLineNumbers = true,
2727
showConsole = true,
28-
autorun = false,
29-
height = 300,
28+
autorun = true,
29+
height = 400,
3030
}) {
3131
const { colorMode } = useColorMode();
3232
const theme = colorMode === 'dark' ? 'dark' : 'light';
@@ -91,10 +91,13 @@ export default function CodePlayground({
9191
showLineNumbers: showLineNumbers,
9292
showInlineErrors: true,
9393
showConsole: showConsole,
94-
showConsoleButton: true,
94+
showConsoleButton: showConsole,
9595
editorHeight: height,
9696
autorun: autorun,
97+
autoReload: true,
9798
closableTabs: false,
99+
resizablePanels: true,
100+
editorWidthPercentage: 50,
98101
}}
99102
customSetup={{
100103
dependencies: {},

0 commit comments

Comments
 (0)