<template>
|
<div>
|
<div class="OwO fadeIn " style="z-index:10" v-bind:class="{'OwO-open':open}">
|
<div class="OwO-logo" @click="openOwO"><span>OωO</span></div>
|
<div class="OwO-body" style="width: 100%;position: initial;">
|
<div class="OwO-jio"></div>
|
<ul class="OwO-items OwO-items-emoticon " style="max-height: 197px;"
|
v-for="(packageKey, index ) in packages" v-bind:class="{'OwO-items-show':selectTabIndex==index}">
|
<div v-if="myConfig[packageKey].type=='image'">
|
|
<li class="OwO-item" :data-id="item.data" :title="item.text"
|
v-for="(item,index ) in myConfig[packageKey].container" @click="getCotent(item,false)">
|
<img loading="lazy" :class="'biaoqing '+item.css" :src="item.icon">
|
</li>
|
</div>
|
|
<div v-else>
|
<li class="OwO-item" data-id="not-given" :title="item.text"
|
v-for="(item,index) in myConfig[packageKey].container" @click="getCotent(item,true)">
|
{{item.icon}}
|
</li>
|
</div>
|
</ul>
|
|
<div class="OwO-bar" style="height: auto;">
|
<ul class="OwO-packages">
|
<li v-bind:class="{'OwO-package-active':selectTabIndex==index}" @click="switchTab(index)"
|
style="border-bottom: 1px solid;" v-for="(packagesName,index) in packages">
|
<span>{{packagesName}}</span>
|
</li>
|
</ul>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import '../../assets/css/OwO.min.css';
|
import OwOjsonConfig from '../../assets/OwO.json';
|
|
export default {
|
data() {
|
return {
|
open: false,
|
selectTabIndex: 0,
|
tabNameList: [],
|
packages: null,
|
myConfig: OwOjsonConfig,
|
selectContext: null
|
}
|
},
|
methods: {
|
switchTab(index) {
|
this.selectTabIndex = index;
|
},
|
openOwO() {
|
this.open = !this.open
|
this.init()
|
},
|
init() {
|
if (this.packages != null) {
|
return
|
}
|
this.packages = Object.keys(OwOjsonConfig);
|
},
|
getCotent(item, outputType) {
|
if (outputType) {
|
this.selectContext = item.icon;
|
} else {
|
this.selectContext = item.data;
|
}
|
this.$emit("insertOwO", this.selectContext)
|
},
|
|
}
|
}
|
</script>
|
|
<style lang="less">
|
|
</style>
|