In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "how to achieve tabs by WeChat Mini Programs". The editor shows you the operation process through an actual case, and the operation method is simple, fast and practical. I hope this article "how to achieve tabs by WeChat Mini Programs" can help you solve the problem.
The realization method of WeChat Mini Programs's Tab
Foreword:
Students engaged in the front end must be familiar with tabs, whether they are written by themselves or in various UI frameworks. I think we have all used a lot of tabs and are clear enough about the principle of tabs. Let's implement the function of tabs in WeChat Mini Programs.
WeChat Mini Programs does not have its own tab component, but it does have a swiper component, so we use swiper to achieve the tab function.
Take a look at the effect picture first:
Implementation code:
Page code:
One, two, three, first screen, second screen, third screen.
Js Code:
Var app=getApp () Page ({data: {currentTab:0}, onLoad:function (options) {/ / parameters brought by page initialization options for page jump}, / / sliding switch swiperTab:function (e) {var that=this; that.setData ({currentTba:e.detail.current});}, / / Click to switch clickTab: function (e) {var that=this; if (this.data.currentTab = e.target.dataset.current) {return false } else {that.setData ({currentTab: e.target.dataset.current})})
Css Code:
.swiper-tab {width: 100%; border-bottom: 2rpx solid # ccc; text-align: center; height: 88rpx; line-height: 88rpx; font-weight: bold;} .swiper-tab-item {display: inline-block; width: 33.33%; color:red;} .active {color:aqua; border-bottom: 4rpx solid red;} about "how to implement WeChat Mini Programs tab", thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.