跳到主要内容

1. NextJs 使用

可参考 NextJs Demo

import dynamic from 'next/dynamic';

import 'solive-core/dist/index.css';

const Editor = dynamic(
() => import('solive-core'),
{ ssr: false },
);

// ...

2. Docusaurus2 使用

React Component

参考 Docusaurus2 Demo

<BrowserOnly fallback={<div>Loading...</div>}>
{() => {
// eslint-disable-next-line @typescript-eslint/no-var-requires,global-require
const Editor = require('solive-core').default;
return (
<Editor
id="1"
modelInfos={[]}
height="500px"
/>
);
}}
</BrowserOnly>

Doc MDX Plugin

查看 docusaurus-plugin-solive