0.2.20 • Published 12 months ago
laf-react-editor v0.2.20
laf-react-editor
用于react项目的富文本编辑器,基于 Tiptap。
安装
pnpm i laf-react-editor
特性
- 支持基础的markdown语法
- 支持自定义编辑器的插件
- 支持i18n
使用
// main.tsx
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.tsx';
import './index.css';
import 'laf-react-editor/dist/style.css';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
// App.tsx
import { useEditor, RichTextEditor, allExtensions } from 'laf-react-editor';
function App() {
const editor = useEditor({
content: '',
extensions: allExtensions,
});
const read = () => {
console.log(editor?.getHTML());
};
return (
<>
<button onClick={() => read()}>get</button>
<div style={{ height: '100vh', width: '80vw', margin: '0 auto' }}>
<RichTextEditor editor={editor!} />
</div>
</>
);
}
export default App;
Github
0.1.20
12 months ago
0.1.12
12 months ago
0.1.14
12 months ago
0.2.16
12 months ago
0.2.15
12 months ago
0.2.11
12 months ago
0.2.10
12 months ago
0.2.20
12 months ago
0.2.1
12 months ago
0.2.0
12 months ago
0.1.16
12 months ago
0.1.18
12 months ago
0.1.0
2 years ago
0.1.10
2 years ago
0.1.1
2 years ago
0.1.6
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.2
2 years ago