1 Star 0 Fork 0

柠檬忒酸 / wx-tabbar

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README.md 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
刘乃明 提交于 2019-11-10 16:01 . edit md

tabbar

WeChat small program tabbar
1、在template.js按照对应的key配置对应数据,其中current表示是否 选择当前的tab,直接配置为0即可
2、在对应的js引用template文件夹中的templalte.js------>var template = require('../../template/template.js');
3、然后在onLoad生命周期中注册对应的tabbar-------> template.tabbar("tabBar", 0, this)//0表示第一个tabbar,1表示第二个tabbar如此类推
4、在对应的wxml中引入template.wxml------>
5、使用模板------------->

注意:第5点data属性中格式必定为该格式,原因如下:
1、与template.wxml中的绑定的tabBar对应
......
2、template.js中使用that.setData({ bindData });表明bindData作为key
3、index.js或其他页面js使用template.tabbar("tabBar", 0, this)来使用注册template,其中的"tabBar"对应bindData.tabBar中tabBar

JavaScript
1
https://gitee.com/lau686/wx-tabbar.git
git@gitee.com:lau686/wx-tabbar.git
lau686
wx-tabbar
wx-tabbar
master

搜索帮助