Use StillImage to render emojis in emoji picker
This commit is contained in:
parent
c93da0b865
commit
b77259a9a0
4 changed files with 36 additions and 8 deletions
|
|
@ -118,8 +118,19 @@ const EmojiPicker = {
|
|||
},
|
||||
initializeLazyLoad () {
|
||||
this.destroyLazyLoad()
|
||||
this.$lozad = lozad('img', {})
|
||||
this.$lozad.observe()
|
||||
this.$nextTick(() => {
|
||||
this.$lozad = lozad('.still-image.emoji-picker-emoji', {
|
||||
load: el => {
|
||||
const vn = el.__vue__
|
||||
if (!vn) {
|
||||
return
|
||||
}
|
||||
|
||||
vn.loadLazy()
|
||||
}
|
||||
})
|
||||
this.$lozad.observe()
|
||||
})
|
||||
},
|
||||
waitForDomAndInitializeLazyLoad () {
|
||||
this.$nextTick(() => this.initializeLazyLoad())
|
||||
|
|
|
|||
|
|
@ -89,10 +89,11 @@
|
|||
@click.stop.prevent="onEmoji(emoji)"
|
||||
>
|
||||
<span v-if="!emoji.imageUrl">{{ emoji.replacement }}</span>
|
||||
<img
|
||||
<still-image
|
||||
v-else
|
||||
class="emoji-picker-emoji"
|
||||
:data-src="emoji.imageUrl"
|
||||
>
|
||||
/>
|
||||
</span>
|
||||
<span :ref="'group-end-' + group.id" />
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue