CodeBlockRuntime non-ejectable
Warning
该组件是非 ejectable 组件,代码与核心代码耦合度较高,不建议通过 wrap/eject 进行定制。
CodeBlockRuntime 用于在运行时渲染可执行的代码块。
用法
index.mdx
传入 lang、title、code 渲染代码块;shikiOptions 可自定义高亮配置。
Warning
建议仅在必要条件下使用 CodeBlockRuntime,因为它会增加运行时的包体积,尤其是在需要引入多门语言的时候,并且无法享受编译时高亮带来的性能优势。