longyvfengyun
2023-12-25 d8d792a6842832e8f6af6604274c438b25053afe
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
83
<template>
    <div class="filter-box">
        <div class="filter-box-content" :class="{'hide-content': !status}">
            <slot>暂无内容</slot>
        </div>
        <div class="filter-box-footer" @click="changeStatus">
            {{buttonText}}
        </div>
    </div>
</template>
 
<script>
export default {
   props: {
       buttonTexts: {
           type: Array,
           default() {
               return ['关闭筛选窗口', '打开筛选窗口']
           }
       }
   },
   data() {
       return {
           status: false
       }
   },
   methods: {
       changeStatus() {
           this.status = this.status?false: true;
           this.$emit('click', this.status);
       },
   },
   computed: {
       buttonText() {
           if(this.status) {
               return this.buttonTexts[0];
           }else {
               return this.buttonTexts[1];
           }
           
       },
   } 
}
</script>
 
<style scoped>
.filter-box {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9;
    min-width: 360px;
    background-color: rgb(12 86 121 / 80%);
}
.filter-box-content.hide-content {
    height: 0;
    transition: height .3s ease-in;
    overflow: hidden;
}
.filter-box-footer {
    padding-top: 4px;
    padding-bottom: 4px;
    text-align: center;
    font-size: 14px;
    color: #FFFFFF;
    background-color: #252424;
 
    cursor: pointer;
 
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    border-left: 1px solid #252424;
    border-right: 1px solid #252424;
}
.filter-box-footer:hover {
    background-color: #000000;
}
.filter-box-footer:active {
    color: #dbd8d8;
}
</style>