优化内容展示

This commit is contained in:
aixianling
2023-06-12 16:46:12 +08:00
parent 5b00073271
commit 5cc0b732c4
2 changed files with 5 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
<div class="chat-friend" v-if="item.uid !== 'me'"> <div class="chat-friend" v-if="item.uid !== 'me'">
<div class="chat-text" v-if="item.chatType == 0"> <div class="chat-text" v-if="item.chatType == 0">
<icon-copy @click="copy(item.msg, '已复制')"/> <icon-copy @click="copy(item.msg, '已复制')"/>
<v-md-preview :text="item.msg.trim()"/> <v-md-preview :text="optimizeMessage(item.msg)"/>
</div> </div>
<div class="chat-img" v-if="item.chatType == 1"> <div class="chat-img" v-if="item.chatType == 1">
<img :src="item.msg" alt="表情" v-if="item.extend.imgType == 1" style="width: 100px; height: 100px"/> <img :src="item.msg" alt="表情" v-if="item.extend.imgType == 1" style="width: 100px; height: 100px"/>
@@ -56,6 +56,9 @@ export default {
if (copyToClipboard(msg)) { if (copyToClipboard(msg)) {
this.$message.success("已复制") this.$message.success("已复制")
} }
},
optimizeMessage(msg = "") {
return msg.trim()
} }
} }
} }

View File

@@ -25,7 +25,7 @@ export default {
}, },
methods: { methods: {
handleShortKey(e) { handleShortKey(e) {
if (e.ctrlKey && e.keyCode == 13) { if (e.keyCode == 13) {
this.$emit('update:modelValue', this.text) this.$emit('update:modelValue', this.text)
this.text = "" this.text = ""
this.$emit('enter') this.$emit('enter')