程序实现tab更换页面效果

网友投稿 334 2023-11-14

本文实例为大家分享了小程序实现tab更换页面效果的具体代码,供大家参考,具体内容如下

小程序实现tab更换页面效果

.wxml

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<scroll-view scroll-x="true" class="ip_tab_comtainer">
<view class="ip_tab_comtainer_padd"></view>
<block wx:for="{{ips}}" wx:for-item="ip" wx:key="{{ip.id}}">
<view class="{{ip.isSelect?ip_tab_item_s:ip_tab_item_n}}" bindtap="onIpItemClick" wx:key="" data-item="{{ip}}">
{{ip.title}}
</view>
</block>
<view class="ip_tab_comtainer_padd"></view>
</scroll-view>
<view class=content>
<block>
<view class="content1" wx:if="{{content==日统计}}">{{content}}</view>
<view class="content2" wx:if="{{content==月统计}}">{{content}}</view>
<view class="content3" wx:if="{{content==年统计}}">{{content}}</view>
</block>
</view>

.wxss

?
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
page{
width: 100%;
height: 100%;
}
.ip_tab_comtainer {
width: 100%;
background-color: #F5F5F5;
padding: 20rpx 0 0;
white-space: nowrap;
}
.ip_tab_comtainer_padd {
display: inline-block;
width: 5%; 
}
.ip_tab_item_s {
width: 30%;
display: inline-block;
line-height: 40rpx;
text-align: center;
color: #91daf9;
font-size: 28rpx;
overflow: hidden;
background-color: #ffffff;
border: 1px solid #91daf9;
}
.ip_tab_item_n {
width: 30%;
display: inline-block;
text-align: center;
line-height: 40rpx;
color: #353535;
background-color: #ffffff;
font-size: 28rpx;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
border-radius: 4rpx;
border: 1px solid #CCCCCC;
}
/**
去除横向滚动条
*/
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.content{
width: 100%;
height: 100%;
display: flex;
background-color: #CCCCCC;
}
.content1{
width: 100%;
height: 100%;
display: flex;
background-color: #6b10e0;
}
.content2{
width: 100%;
height: 100%;
display: flex;
background-color: #d41515;
}
.content3{
width: 100%;
height: 100%;
display: flex;
background-color: #1ac729;
}

.js

以上就是本文的全部内容,希望对大家的学习有所帮助,也

您可能感兴趣的文章:微信小程序自定义可滑动顶部TabBar选项卡实现页面切换功能示例微信小程序开发实现的选项卡(窗口顶部/底部TabBar)页面切换功能图文详解微信小程序实现tab页面切换功能微信小程序开发之选项卡(窗口底部TabBar)页面切换微信小程序开发之实现选项卡(窗口顶部TabBar)页面切换小程序tab实现页面切换

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:应用公园制作app软件
下一篇:个人怎么做app软件
相关文章

 发表评论

暂时没有评论,来抢沙发吧~