|
|
@ -382,7 +382,7 @@ |
|
|
watch: { |
|
|
watch: { |
|
|
chat: { |
|
|
chat: { |
|
|
handler(newChat, oldChat) { |
|
|
handler(newChat, oldChat) { |
|
|
if (newChat.targetId > 0 && (newChat.type != oldChat.type || newChat.targetId != oldChat.targetId)) { |
|
|
if (newChat.targetId > 0 && (!oldChat || newChat.type != oldChat.type || newChat.targetId != oldChat.targetId)) { |
|
|
if (this.chat.type == "GROUP") { |
|
|
if (this.chat.type == "GROUP") { |
|
|
this.loadGroup(this.chat.targetId); |
|
|
this.loadGroup(this.chat.targetId); |
|
|
} else { |
|
|
} else { |
|
|
@ -391,10 +391,12 @@ |
|
|
this.scrollToBottom(); |
|
|
this.scrollToBottom(); |
|
|
this.sendText = ""; |
|
|
this.sendText = ""; |
|
|
// 保持输入框焦点 |
|
|
// 保持输入框焦点 |
|
|
|
|
|
this.$nextTick(() => { |
|
|
this.$refs.sendBox.focus(); |
|
|
this.$refs.sendBox.focus(); |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
deep: true |
|
|
immediate: true |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|