zhangxiao
2024-08-26 57b66478e7e335379435b31c20da4619bd1411f5
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
<template>
    <div class="app-tags">
        <div class="tab-bar-box">
            <div class="tab-bar-scroll">
                <draggable :list="tagList" class="tags-wrap" item-key="path" animation="200">
                    <template #item="{ element, index }">
                        <app-tag-item :data="element" :index="index" />
                    </template>
                </draggable>
            </div>
        </div>
    </div>
</template>
<script lang="ts" setup name="AppTags">
import draggable from "vuedraggable";
import routes from "@/config/pinia/routes";
import AppTagItem from "./tag-item.vue";
 
const tagList = computed(() => {
    return routes().navTags;
});
</script>
<style lang="scss" scoped>
.app-tags {
    position: relative;
    background-color: var(--color-bg-2);
    .tab-bar-box {
        display: flex;
        padding: 0;
        background-color: var(--color-bg-2);
        // border-bottom: 1px solid var(--color-border);
        height: 100%;
        .tab-bar-scroll {
            flex: 1;
            overflow: hidden;
            .tags-wrap {
                display: flex;
                align-items: center;
                flex-wrap: nowrap;
                height: 100%;
                white-space: nowrap;
                overflow-x: auto;
                overflow-y: hidden;
                @include scroll-x;
 
                :deep(.tag-item) {
                    display: inline-flex;
                    align-items: center;
                    margin-right: 6px;
                    flex-shrink: 0;
                    cursor: pointer;
                    &:first-child {
                        .arco-tag-close-btn {
                            display: none;
                        }
                    }
                }
            }
        }
    }
}
</style>