Tab.wxss
1.12 KB
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
/* components/Tab/Tab.wxss */
@import "/assets/style/common.wxss";
.tab-box {
display: flex;
width: 100%;
height: 92rpx;
box-sizing: border-box;
background: #fff;
}
.tab-box.left{
padding-left: 32rpx;
}
.left .tab{
padding-right:40rpx;
}
.flex .tab {
flex: 1;
}
.tab {
position: relative;
flex-shrink: 0;
}
.tab .text {
height: 84rpx;
display: flex;
align-items: center;
box-sizing: border-box;
color: #1B233D;
justify-content: center;
font-size: 30rpx;
/* 添加以下属性防止文本换行 */
white-space: nowrap;
min-width: 100%;
transition: all 0.25s;
}
.left .text{
justify-content: flex-start;
}
.flex .tab .text {
padding: 0;
}
.tab.active .text {
font-weight: 600;
transition: all .25s;
color:#1B233D;
/* 确保激活状态下文本不会换行 */
white-space: nowrap;
}
.tab .line {
width: 48rpx;
height: 8rpx;
background: var(--themeColor);
border-radius: 6rpx;
margin: 0 auto;
transform: scale(0);
transition: all .25s;
}
.tab.active .line {
transform: scale(1);
}
.tab-box::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}