配置项(关于使用组件)

index.wxml

<!--
tabBar:tabBar配置
activeIndex: 激活页面下标
slots: 多插槽配置(需与页面一致)
--> <tabbar data="{{tabBar}}" activeIndex="0" solts="{{solts}}">
<view slot="index">index1...</view>
<view slot="other">other2...</view>
<view slot="my">my3....</view>
<view slot="hello">hello...4</view>
<view slot="bat">bat...5</view>
</tabbar>

index.js(data

  tabBar: {
"selectedColor": "#5DBCFF",
"normalColor": "#333",
"backgroundColor": "#fff",
"selectedBackgroundColor": "#fff",
"list": [{
"pagePath": "market/index/index",
"iconPath": "images/icon_home.png",
"selectedIconPath": "images/icon_home_selected.png",
"text": "首页"
}, {
"pagePath": "tools/index/index",
"iconPath": "images/icon_cate.png",
"selectedIconPath": "images/icon_cate_selected.png",
"text": "分类"
}, {
"pagePath": "viewing/index/index",
"iconPath": "images/icon_member.png",
"selectedIconPath": "images/icon_member_selected.png",
"text": "我"
}, {
"pagePath": "viewing/index/index",
"iconPath": "images/icon_member.png",
"selectedIconPath": "images/icon_member_selected.png",
"text": "Hello"
}, {
"pagePath": "viewing/index/index",
"iconPath": "images/icon_member.png",
"selectedIconPath": "images/icon_member_selected.png",
"text": "Bat"
}]
},
solts: [{
name: 'index'
}, {
name: 'other'
}, {
name: 'my'
}, {
name: 'hello'
}, {
name: 'bat'
}]

  

示例:点击下载

微信小程序 - 自定义tabbar(组件)的更多相关文章

  1. 微信小程序自定义 tabbar

    一定的需求情况下,无法使用小程序原生的 tabbar 的时候,需要自行实现一个和 tabbar 功能一模一样的自制组件. 查阅了海量的博客和文档之后,亲自踩坑.总结了三种在不使用微信小程序原生 tab ...

  2. 微信小程序自定义tabbar的实现

    微信小程序自定义tabbar的实现 目的:当采用微信的自定义tabbar组件的时候,切换的时候会出现闪屏的效果:当使用微信默认的tabbar的时候,限制了tabbar的数量以及灵活配置. 方案:自己动 ...

  3. 微信小程序自定义音频组件,自定义滚动条,单曲循环,循环播放

    小程序自定义音频组件,带滚动条 摘要:首先自定义音频组件,是因为产品有这样的需求,需要如下样式的 而微信小程序API给我们提供的就是这样的 而且产品需要小程序有后台播放功能,所以我们不考虑小程序的 a ...

  4. 微信小程序 自定义导航组件 nav头部 全面屏设计

    nav-dynamic 微信小程序自定义nav头部组件:适配全面屏设计: 实现功能 初始进入页面时,展示初始状态下的nav样式: 页面滚动时,监听页面滚动事件,展示滚动状态下的nav样式: 根据配置字 ...

  5. 微信小程序 - 自定义tabbar

    更新: 2019-1-18:自定义tabbar组件已发布 各种奇葩的需求,造就了我们 wxml <view class="nav-tabs"> <view cla ...

  6. 微信小程序 自定义tabbar实例

    在小程序的开发文档中,对tabbar是这样说明的: 如果小程序是一个多 tab 应用(客户端窗口的底部或顶部有 tab 栏可以切换页面),可以通过 tabBar 配置项指定 tab 栏的表现,以及 t ...

  7. 微信小程序自定义TabBar

    项目中需要根据用户角色控制TabBar中各Item的显示和隐藏,然而小程序自带TabBar没有提供隐藏某个item的功能,只好自己动手写了一个. 1.wxml文件 <view class=&qu ...

  8. 微信小程序——自定义图标组件

    字体图标在网页中非常常见了.为了方便在小程序里面重复使用,自定义了一个图标组件,方便控制它的大小,颜色,自定义点击事件. 自定义图标组件的代码如下: 下面的代码是icon文件夹下面的4个文件 inde ...

  9. 微信小程序自定义tabbar的问题

    个人感觉小程序的tab样式自定义的能力有所欠缺,不够美观,于是今天自己diy了一个tab 测试的时候发现,无论是使用navigator跳转(会出现点击的效果)还是用bindtap(触摸),因为没有定义 ...

随机推荐

  1. IllegalStateException: Can not perform this action after onSaveInstanceState

    http://www.cnblogs.com/zgz345/archive/2013/03/04/2942553.html 今天使用Fragment的时候,出现了这个错误 IllegalStateEx ...

  2. ZooKeeper_客户端工具zkCli.sh使用

    #一.命令 [root@VM_31_182_centos bin]# ./zkCli.sh -server 127.0.0.1:2181   #二.帮助命令 help #三.创建.修改.删除.退出de ...

  3. spring boot application.properties

    1 <properties> <timestamp>${maven.build.timestamp}</timestamp><maven.build.time ...

  4. SVG.js 基础图形绘制整理(一)

    一.矩形 //指定width和height 画矩形 //返回rect对象 var draw = SVG('svg1').size(300, 300); var rect = draw.rect(100 ...

  5. composer - No business network has been specified for this connection 解决方案

    I have installed hyperledger composer locally. But on localhost it gives error : Error : Error tryin ...

  6. Unit Testing of Spring MVC Controllers: “Normal” Controllers

    Original link: http://www.petrikainulainen.net/programming/spring-framework/unit-testing-of-spring-m ...

  7. [leetcode]Symmetric Tree @ Python

    原题地址:https://oj.leetcode.com/problems/symmetric-tree/ 题意:判断二叉树是否为对称的. Given a binary tree, check whe ...

  8. 技术向:一文读懂卷积神经网络CNN

    转自:http://dataunion.org/11692.html 作者:张雨石 自今年七月份以来,一直在实验室负责卷积神经网络(Convolutional Neural Network,CNN), ...

  9. 硬链接(hard link)和符号连接(symbolic link)

    inode ====== 在Linux系统中,内核为每一个新创建的文件分配一个inode,每个文件都有一个惟一的inode号,我们可以将inode简单理解成一个指针,它永远指向本文件的具体存储位置.文 ...

  10. [PowerShell Utils] Automatically Change DNS and then Join Domain

    I would like to start a series of blog posts sharing PowerShell scripts to speed up our solution ope ...