@onionsix/fe-editor
v0.0.29
Published
> TODO: description
Downloads
143
Readme
每记web编辑器文档
TODO: description
安装
yarn add @5e/editorimport React, { useState } from 'react';
import { Editor } from '@5e/editor';
import 'react-quill/dist/quill.snow.css';
import '@5e/editor/lib/index.css';
const App = () => {
const [value, setValue] = useState({});
const onChangeValue = () => {
// 编辑器value change
};
const onBlurValue = () => {
// 失去焦点执行change操作
};
return (
<Editor
editValue={value}
onChangeValue={onChangeValue}
onBlurValue={onBlurValue}
/>
);
};
export default App;API
| 属性 | 说明 | 类型 | 默认值 | | ------------- | ------------- | ------------------------------------------------- | ------ | | editValue | 编辑器内容 | {title: string; content: string} | - | | style | 编辑器样式 | {height?: number} | - | | onBlurValue | 失去焦点触发 | (value: {title: string; content: string}) => void | - | | onChangeValue | onchange 触发 | (value: {title: string; content: string}) => void | - |
