refs #681 Insert selected emoji from emoji picker
This commit is contained in:
parent
50c8bea5f0
commit
67a53b0429
|
@ -34,14 +34,17 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<el-button type="text" class="emoji-selector" @click="toggleEmojiPicker" v-click-outside="hideEmojiPicker">
|
<div v-click-outside="hideEmojiPicker">
|
||||||
<icon name="regular/smile" scale="1.2"></icon>
|
<el-button type="text" class="emoji-selector" @click="toggleEmojiPicker">
|
||||||
</el-button>
|
<icon name="regular/smile" scale="1.2"></icon>
|
||||||
<div v-show="openEmojiPicker" class="emoji-picker">
|
</el-button>
|
||||||
<picker
|
<div v-show="openEmojiPicker" class="emoji-picker">
|
||||||
set="emojione"
|
<picker
|
||||||
:autoFocus="true"
|
set="emojione"
|
||||||
/>
|
:autoFocus="true"
|
||||||
|
@select="selectEmoji"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -284,6 +287,11 @@ export default {
|
||||||
},
|
},
|
||||||
hideEmojiPicker () {
|
hideEmojiPicker () {
|
||||||
this.openEmojiPicker = false
|
this.openEmojiPicker = false
|
||||||
|
},
|
||||||
|
selectEmoji (emoji) {
|
||||||
|
const current = this.$refs.status.selectionStart
|
||||||
|
this.status = `${this.status.slice(0, current)}${emoji.native} ${this.status.slice(current)}`
|
||||||
|
this.hideEmojiPicker()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue