inleft
2022-08-31 3c71cc74e6dd5f1015329c64e11e8ec1cd7a97c1
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<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>