add twemoji

This commit is contained in:
Milos Holba
2021-01-26 23:17:09 +01:00
parent 078d920c19
commit 2112fe879b
9 changed files with 129 additions and 35 deletions
+16 -1
View File
@@ -1,5 +1,6 @@
import i18n from '@/i18n/index'
import store from './store/index'
import twemoji from 'twemoji'
import {debounce, includes} from "lodash";
import {events} from './bus'
import axios from 'axios'
@@ -351,7 +352,21 @@ const Helpers = {
let body = document.body
body.classList.add('windows')
}
}
},
Vue.prototype.$emojisCustomize = function (elementId) {
this.$nextTick(() => {
let list = elementId ? document.getElementById(elementId) : document.body
twemoji.parse(list, {
folder: 'svg',
ext: '.svg',
attributes: () => ({
loading: 'lazy'
})
})
})
}
}
}