|
|
@ -62,8 +62,8 @@ |
|
|
:disabled="lockMessage" @paste.prevent="onEditorPaste" |
|
|
:disabled="lockMessage" @paste.prevent="onEditorPaste" |
|
|
@compositionstart="onEditorCompositionStart" |
|
|
@compositionstart="onEditorCompositionStart" |
|
|
@compositionend="onEditorCompositionEnd" @input="onEditorInput" |
|
|
@compositionend="onEditorCompositionEnd" @input="onEditorInput" |
|
|
:placeholder="placeholder" @blur="onEditBoxBlur()" @keydown.down="onKeyDown" |
|
|
:placeholder="placeholder" @blur="onEditBoxBlur()" @keyup.down="onKeyDown" |
|
|
@keydown.up="onKeyUp" @keydown.enter.prevent="onKeyEnter">x |
|
|
@keyup.up.prevent="onKeyUp" @keydown.enter.prevent="onKeyEnter">x |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div v-show="sendImageUrl" class="send-image-area"> |
|
|
<div v-show="sendImageUrl" class="send-image-area"> |
|
|
@ -164,6 +164,7 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onKeyDown() { |
|
|
onKeyDown() { |
|
|
|
|
|
console.log("onKeyDown") |
|
|
if (this.$refs.atBox.show) { |
|
|
if (this.$refs.atBox.show) { |
|
|
this.$refs.atBox.moveDown() |
|
|
this.$refs.atBox.moveDown() |
|
|
} |
|
|
} |
|
|
@ -188,13 +189,17 @@ |
|
|
this.focusNode = selection.focusNode; |
|
|
this.focusNode = selection.focusNode; |
|
|
this.focusOffset = selection.focusOffset; |
|
|
this.focusOffset = selection.focusOffset; |
|
|
}, |
|
|
}, |
|
|
onEditorInput(e) { |
|
|
onEditorInput(e, e2, e3) { |
|
|
// 如果触发 @ |
|
|
// 如果触发 @ |
|
|
if (this.chat.type == "GROUP" && !this.zhLock) { |
|
|
if (this.chat.type == "GROUP" && !this.zhLock) { |
|
|
|
|
|
console.log("onEditorInput") |
|
|
|
|
|
if (e.inputType === "deleteContentBackward" && !this.atSearchText) { |
|
|
|
|
|
this.$refs.atBox.close(); |
|
|
|
|
|
} |
|
|
if (e.data == '@') { |
|
|
if (e.data == '@') { |
|
|
// 打开选择弹窗 |
|
|
// 打开选择弹窗 |
|
|
this.showAtBox(e); |
|
|
this.showAtBox(e); |
|
|
} else { |
|
|
} else if(this.$refs.atBox.show){ |
|
|
let selection = window.getSelection() |
|
|
let selection = window.getSelection() |
|
|
let range = selection.getRangeAt(0) |
|
|
let range = selection.getRangeAt(0) |
|
|
this.focusNode = selection.focusNode; |
|
|
this.focusNode = selection.focusNode; |
|
|
|