define([
'text!./index.html',
'css!./index.css'
], function (template) {
return {
template,
name: 'emoji',
data() {
return {
emojiData: data,
pannels: ['表情', '自然', '物品', '地点', '符号'],
activeIndex: 0
}
},
methods: {
changeActive(index) {
this.activeIndex = index
},
getPureName(name) {
return name.replace(/:/g, '')
},
selectItem(emoji) {
this.$emit('select', emoji)
}
},
computed: {
emojis() {
return this.pannels.map(item => {
return Object.keys(this.emojiData[item])
})
}
}
};
});