fish-bubble-chat-editor
v1.0.2
Published
Web Chat Rich Text Editor, Ready to Use Out of the Box, Easy to Configure
Downloads
24
Maintainers
Readme
安装
# NPM
$ npm install fish-bubble-chat-editor
# Yarn
$ yarn add fish-bubble-chat-editor
# pnpm
$ pnpm install fish-bubble-chat-editor
使用
// main.tsx
import "fish-bubble-chat-editor/dist/index.css";
import FbChatEditor from "fish-bubble-chat-editor";
<FbChatEditor />;
API
Editor props
| 参数 | 说明 | 类型 | 默认值 | | ------------- | ---------------- | --------------- | ------ | | placeholder | 提示占位符 | string | —— | | className | 扩展类名 | string | —— | | toolbarRender | 自定义工具栏内容 | () => ReactNode | —— | | onSend | 点击发送按钮事件 | () => ReactNode | —— | | onEnterDown | 键盘回车事件 | Function | —— | | onChange | 输入框内容变化时 | Function | —— |
Editor Methods
| 名称 | 说明 | 类型 | | -------- | ------------ | --------------------- | | getValue | 获取输入框值 | () => string | | setValue | 设置输入框值 | (val: string) => void | | clear | 清空输入框值 | () => void | | focus | 获取焦点 | () => void | | blur | 失去焦点 | () => void |