perf: 滑动快捷表情选择

This commit is contained in:
Pang 2024-04-17 07:46:43 +08:00
parent cc125cc292
commit 3c93ad18b2
2 changed files with 8 additions and 0 deletions

View File

@ -28,6 +28,10 @@ export default {
type: Number, type: Number,
default: 20 default: 20
}, },
touchContentBlur: {
type: Boolean,
default: true
},
}, },
data() { data() {
return { return {
@ -248,6 +252,9 @@ export default {
* @param e * @param e
*/ */
onContentTouchStart(e) { onContentTouchStart(e) {
if (!this.touchContentBlur) {
return;
}
const focusedElement = document.activeElement; const focusedElement = document.activeElement;
if (focusedElement) { if (focusedElement) {
focusedElement.blur(); focusedElement.blur();

View File

@ -15,6 +15,7 @@
ref="emojiWrapper" ref="emojiWrapper"
:enable-x="true" :enable-x="true"
:enable-y="false" :enable-y="false"
:touch-content-blur="false"
class-name="chat-quick-emoji-wrapper scrollbar-hidden"> class-name="chat-quick-emoji-wrapper scrollbar-hidden">
<li v-for="item in emojiQuickItems" @click="onEmojiQuick(item)"> <li v-for="item in emojiQuickItems" @click="onEmojiQuick(item)">
<img :title="item.name" :alt="item.name" :src="item.src"/> <img :title="item.name" :alt="item.name" :src="item.src"/>