1.0.5 • Published 10 months ago
channelwill-editor v1.0.5
Channelwill Editor
Channelwill Editor 是一个基于 Lexical 的富文本编辑器,提供了简单易用的接口,方便集成到你的项目中。
安装
使用 npm 安装:
npm install channelwill-editor使用
在你的 React 项目中引入并使用 Editor 组件:
import React from 'react';
import { Editor } from 'channelwill-editor';
function MyComponent() {
return (
<div>
<h1>My Rich Text Editor</h1>
<Editor />
</div>
);
}
export default MyComponent;API
Editor
Editor 是一个 React 组件,用于渲染富文本编辑器。
cw 类
cw 类提供了一些方法来操作编辑器的内容:
getContent(): string- 获取编辑器的当前内容。setContent(content: string): void- 设置编辑器的内容。clearContent(): void- 清空编辑器的内容。
开发
如果你想为这个项目做贡献,请遵循以下步骤:
克隆仓库:
git clone https://github.com/yourusername/channelwill-editor.git安装依赖:
npm install启动开发服务器:
npm run dev
贡献
欢迎贡献代码!请确保在提交 PR 之前运行所有测试并遵循项目的代码风格。
许可证
MIT License. 详见 LICENSE 文件。