跳到主要内容

📦 theme-live-codeblock

这个主题提供了一个 @theme/CodeBlock 组件,该组件基于 react-live 构建。您可以在 交互式代码编辑器 章节查阅相关文档。

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

配置

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