2.0.9 • Published 5 months ago

fish-chat-editor v2.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

安装

 # NPM
$ npm install fish-chat-editor
# Yarn
$ yarn add fish-chat-editor
# pnpm
$ pnpm install fish-chat-editor

使用

// main.tsx
import "fish-chat-editor/dist/index.css";
import FishChatEditor from "fish-chat-editor";

<FishChatEditor />;

API

Editor props

参数说明类型默认值
placeholder提示占位符string——
className扩展类名string——
emojiList表情列表数据,请看下面的IEmojiType描述IEmojiType[]——
toolbarRender自定义工具栏内容() => ReactNode——
onSend点击发送按钮事件(editor) => void——
onEnterDown编辑器键盘回车事件(editor) => void——
onChange编辑器内容变化时(editor) => void——
beforePasteImage粘贴图片之前的钩子, 参数files为粘贴的文件,amount为富文本中已有的图片个数; 若返回为空数组则停止粘贴,若返回为文件数组则继续处理(files: File[], amount: number) => File[] or []——

Editor Methods

名称说明类型
clear清空输入框值() => void
focus获取焦点() => void
blur失去焦点() => void
fishEditor编辑器 API (具体看FishEditor描述)obj as FishEditor

IEmojiType描述

export type IEmojiType = {
  /** 表情的url地址 */
  url: string;
  /** 表情的名称,必须是“[爱心]”的格式 */
  name: string;
  /** 表情的tip提示名 */
  title: string;
};
// 如:
export const emoji: { [key: string]: string } = {
  "[爱你]": "www.cc.com/[爱你].png"
};
2.0.9

5 months ago

2.0.8

5 months ago

2.0.7

6 months ago

2.0.6

6 months ago

2.0.5

7 months ago

2.0.3

7 months ago

2.0.4

7 months ago

2.0.2

7 months ago

2.0.1

7 months ago

1.2.2

9 months ago

1.2.1

9 months ago

1.2.0

10 months ago

1.1.3

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.79

10 months ago

1.0.78

10 months ago

1.0.75

10 months ago

1.0.7

10 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago