|
@@ -5,161 +5,28 @@
|
|
|
<li v-for="(item, key) in recentList"
|
|
|
:key="key"
|
|
|
v-html="item"
|
|
|
- @click="handleClick"></li>
|
|
|
- </ul>
|
|
|
- <p class="title">全部</p>
|
|
|
- <ul>
|
|
|
- <li v-for="(item, key) in emojiList"
|
|
|
- :key="key"
|
|
|
- v-html="item"
|
|
|
- @click="handleClick"></li>
|
|
|
+ @click="handleClick(item.names, $event)"></li>
|
|
|
</ul>
|
|
|
+ <div v-for="(arr, key) in emojiList" :key="key">
|
|
|
+ <p class="title">{{key}}</p>
|
|
|
+ <ul>
|
|
|
+ <li v-for="(item, ind) in arr"
|
|
|
+ :key="ind"
|
|
|
+ v-html="item.surrogates"
|
|
|
+ @click="handleClick(item.names, $event)"></li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { emojiList } from '@/util/emoji'
|
|
|
|
|
|
export default {
|
|
|
name: 'emojiList',
|
|
|
- computed: {
|
|
|
- emojiList () {
|
|
|
- return this.faceList.concat(this.animalList)
|
|
|
- }
|
|
|
- },
|
|
|
data () {
|
|
|
return {
|
|
|
- faceList: [
|
|
|
- '😀',
|
|
|
- '😁',
|
|
|
- '😂',
|
|
|
- '😃',
|
|
|
- '😄',
|
|
|
- '😅',
|
|
|
- '😆',
|
|
|
- '😇',
|
|
|
- '😈',
|
|
|
- '😉',
|
|
|
- '😊',
|
|
|
- '😋',
|
|
|
- '😌',
|
|
|
- '😍',
|
|
|
- '😎',
|
|
|
- '😏',
|
|
|
- '😐',
|
|
|
- '😑',
|
|
|
- '😒',
|
|
|
- '😓',
|
|
|
- '😔',
|
|
|
- '😕',
|
|
|
- '😖',
|
|
|
- '😗',
|
|
|
- '😘',
|
|
|
- '😙',
|
|
|
- '😚',
|
|
|
- '😛',
|
|
|
- '😜',
|
|
|
- '😝',
|
|
|
- '😞',
|
|
|
- '😟',
|
|
|
- '😠',
|
|
|
- '😡',
|
|
|
- '😢',
|
|
|
- '😣',
|
|
|
- '😤',
|
|
|
- '😥',
|
|
|
- '😦',
|
|
|
- '😧',
|
|
|
- '😨',
|
|
|
- '😩',
|
|
|
- '😪',
|
|
|
- '😫',
|
|
|
- '😬',
|
|
|
- '😭',
|
|
|
- '😮',
|
|
|
- '😯',
|
|
|
- '😰',
|
|
|
- '😱',
|
|
|
- '😲',
|
|
|
- '😳',
|
|
|
- '😴',
|
|
|
- '😵',
|
|
|
- '😶',
|
|
|
- '😷'
|
|
|
- ],
|
|
|
- animalList: [
|
|
|
- '😺',
|
|
|
- '😸',
|
|
|
- '😹',
|
|
|
- '😻',
|
|
|
- '😼',
|
|
|
- '😽',
|
|
|
- '🙀',
|
|
|
- '😿',
|
|
|
- '😾',
|
|
|
- '🙈',
|
|
|
- '🙉',
|
|
|
- '🙊',
|
|
|
- '👶',
|
|
|
- '🧒',
|
|
|
- '👦',
|
|
|
- '👧',
|
|
|
- '🧑',
|
|
|
- '👨',
|
|
|
- '👩',
|
|
|
- '🧓',
|
|
|
- '👴',
|
|
|
- '👿',
|
|
|
- '🤡',
|
|
|
- '👹',
|
|
|
- '👺',
|
|
|
- '💀',
|
|
|
- '☠',
|
|
|
- '👻',
|
|
|
- '👽',
|
|
|
- '👾',
|
|
|
- '🤖',
|
|
|
- '💩',
|
|
|
- '🐒',
|
|
|
- '🦍',
|
|
|
- '🐶',
|
|
|
- '🐕',
|
|
|
- '🐩',
|
|
|
- '🐺',
|
|
|
- '🦊',
|
|
|
- '🦝',
|
|
|
- '🐱',
|
|
|
- '🐈',
|
|
|
- '🦁',
|
|
|
- '🐯',
|
|
|
- '🐅',
|
|
|
- '🐆',
|
|
|
- '🐴',
|
|
|
- '🐎',
|
|
|
- '🦄',
|
|
|
- '🦓',
|
|
|
- '🦌',
|
|
|
- '🐮',
|
|
|
- '🐂',
|
|
|
- '🐃',
|
|
|
- '🐄',
|
|
|
- '🐷',
|
|
|
- '🐖',
|
|
|
- '🐗',
|
|
|
- '🐽',
|
|
|
- '🐏',
|
|
|
- '🐑',
|
|
|
- '🐐',
|
|
|
- '🐪',
|
|
|
- '🐫',
|
|
|
- '🦙',
|
|
|
- '🦒',
|
|
|
- '🐘',
|
|
|
- '🦏',
|
|
|
- '🦛',
|
|
|
- '🐭',
|
|
|
- '🐁',
|
|
|
- '🐀'
|
|
|
- ],
|
|
|
+ emojiList,
|
|
|
recentList: []
|
|
|
}
|
|
|
},
|
|
@@ -167,9 +34,9 @@ export default {
|
|
|
this.recentList = JSON.parse(localStorage.getItem('recentEmoji')) || []
|
|
|
},
|
|
|
methods: {
|
|
|
- handleClick ($el) {
|
|
|
- let val = $el.target.innerHTML
|
|
|
- this.$emit('addEmoji', val)
|
|
|
+ handleClick (name, event) {
|
|
|
+ let val = event.target.innerHTML
|
|
|
+ this.$emit('addEmoji', JSON.stringify(name))
|
|
|
if (this.recentList.length > 11) {
|
|
|
this.recentList.pop()
|
|
|
}
|