-
Notifications
You must be signed in to change notification settings - Fork 48
/
exampleCustomTemplates.vue
66 lines (63 loc) · 1.74 KB
/
exampleCustomTemplates.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<template>
<div class="example">
<h2>Custom Search And Preview Templates Example</h2>
<div class="row">
Custom UI for search and preview areas by overwriting default Picker
slots.
</div>
<div class="row">
<Picker :data="index" :native="true">
<template slot="searchTemplate" slot-scope="slotProps">
<input
type="text"
:placeholder="slotProps.i18n.search"
v-on:input="slotProps.onSearch($event.target.value)"
/>
</template>
<template slot="previewTemplate" slot-scope="slotProps">
<div class="emoji-mart-preview">
<div class="emoji-mart-preview-emoji">
<Emoji
:data="slotProps.data"
:emoji="slotProps.emoji ? slotProps.emoji : 'point_up'"
:native="slotProps.emojiProps.native"
:skin="slotProps.emojiProps.skin"
:set="slotProps.emojiProps.set"
/>
</div>
<div class="emoji-mart-preview-data">
<div class="emoji-mart-preview-name">
{{
slotProps.emoji
? '~' + slotProps.emoji.name + '~'
: 'Choose...'
}}
</div>
<div class="emoji-mart-preview-shortnames">
{{ slotProps.emoji ? slotProps.emoji.colons : '' }}
</div>
</div>
</div>
</template>
</Picker>
</div>
</div>
</template>
<script>
import { Picker, Emoji } from '../src'
export default {
props: {
index: {
type: Object,
},
},
data() {
return {}
},
components: {
Picker,
Emoji,
},
}
</script>
<style scoped></style>