Get the App
SLTechnology News&Howtos  ›  Development  › 

How does WeChat Mini Programs realize the custom menu toggle bar tabbar group

Shulou Source: shulou.com Published: 2022-05-31 21:19:41 09月21日 Update

This article mainly explains "WeChat Mini Programs how to achieve custom menu switch bar tabbar group", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "WeChat Mini Programs how to achieve custom menu switch bar tabbar group" it!

Effect picture:

Wxml Code:

{{item}}

Wxss Code:

.top _ tabbar {width: 100%; background-color: # ffffff; display: flex; position: fixed;}. Item_name {text-align: center; margin:20rpx 60rpx; color: grey;} .active {color: lightgreen;} .active text {padding-bottom: 10rpx; border-bottom: 4rpx solid lightgreen;}

Js Code:

Data: {itemName: ["military", "Star", "Animation", "scenery"], tabIndex: 0}, / / get the click event handleItem (e) {/ / console.log (e) const index = e.currentTarget.dataset.index this.setData ({tabIndex: index})} Thank you for reading. This is the content of "how WeChat Mini Programs implements the custom menu switch bar tabbar group". After the study of this article I believe that WeChat Mini Programs how to achieve a custom menu switch bar tabbar group this problem has a deeper understanding, the specific use of the need for everyone to practice and verify. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Programs menus switching code learning content events military animation that is ideas situations effects effects articles stars more knowledge knowledge points articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MySQL OPPO Reno macOS vpn