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
| <template>
| <div>
| <p v-for="(item, key) in data" :key="key" :class="index === key ? 'active' : ''">{{ item }}</p>
| </div>
| </template>
| <script lang="ts" setup name="TheATabs">
| const props = withDefaults(
| defineProps<{
| index: number;
| data?: Array<any>;
| }>(),
| {
| index: 0,
| data: () => []
| }
| );
| </script>
| <style lang="scss" scoped>
| div {
| display: flex;
| align-items: center;
| padding-bottom: 1px;
| border-bottom: 2px solid var(--color-bg-5);
| > p {
| margin-right: 10px;
| width: 86px;
| height: 38px;
| font-size: 14px;
| color: var(--color-text-1);
| line-height: 38px;
| text-align: center;
| border-radius: 6px 6px 0px 0px;
| background: var(--color-bg-2);
| &.active {
| background: #1057fd;
| color: #fff;
| }
| cursor: pointer;
| &:hover {
| opacity: 0.8;
| }
| }
| }
| </style>
|
|