跳到主要内容
版本:3.8.1

📦 theme-live-codeblock

该主题提供了一个 @theme/CodeBlock 组件,它由 react-live 提供支持。您可以在交互式代码编辑器文档中阅读更多内容。

npm install --save @docusaurus/theme-live-codeblock

配置

docusaurus.config.js
export default {
plugins: ['@docusaurus/theme-live-codeblock'],
themeConfig: {
liveCodeBlock: {
/**
* The position of the live playground, above or under the editor
* Possible values: "top" | "bottom"
*/
playgroundPosition: 'bottom',
},
},
};