File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed
apps/docs/zh/components/editorSender
packages/core/src/components/EditorSender Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 132132| 事件名 | 说明 | 回调参数 |
133133| ------------------ | ------------------------ | ------------------------------------------------------- |
134134| ` submit ` | 提交内容时触发 | ` payload: SubmitResult ` - 包含提交的各类内容 |
135+ | ` clear ` | 清空内容时触发 | ` txt: string ` - 参数txt为清空后插入的文本 |
135136| ` change ` | 输入内容发生变化时触发 | 无 |
136137| ` cancel ` | 取消加载状态时触发 | 无 |
137138| ` showAtDialog ` | 显示@用户弹窗时触发 | 无 |
142143
143144| 方法名 | 类型 | 描述 |
144145| ------------------ | ----------------------------------------------------------------- | --------------------------------------------------------------- |
146+ | ` submit ` | () => void | 提交输入内容 |
145147| ` getCurrentValue ` | () => SubmitResult | 获取当前输入框的内容,包括文本、HTML和各类标签信息 |
146148| ` focusToStart ` | () => void | 将光标聚焦到文本最前方 |
147149| ` focusToEnd ` | () => void | 将光标聚焦到文本最后方 |
Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ function onClear(txt?: string) {
178178 chat .value ! .clear (txt );
179179 // 将光标移动到末尾
180180 focusToEnd ();
181+ emits (' clear' ,txt );
181182}
182183// 点击内容区域聚焦输入框
183184function onContentMouseDown() {
@@ -456,6 +457,7 @@ onBeforeUnmount(() => {
456457
457458/** 暴露方法 */
458459defineExpose ({
460+ submit:onSubmit ,
459461 getCurrentValue ,
460462 focusToStart ,
461463 focusToEnd ,
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ export interface EditorSenderEmits {
7474 ( e : 'submit' , payload : SubmitResult ) : void ;
7575 ( e : 'change' ) : void ;
7676 ( e : 'cancel' ) : void ;
77+ ( e : 'clear' , txt : string ) : void ;
7778 ( e : 'showAtDialog' ) : void ;
7879 ( e : 'showSelectDialog' , key : string , elm : HTMLElement ) : void ;
7980 ( e : 'showTagDialog' , prefix : string ) : void ;
You can’t perform that action at this time.
0 commit comments