热门
最新
红包
立Flag
投票
同城
我的
发布
CSDN App 扫码分享
评论
1
打赏
- 复制链接
- 举报
下一条:
小程序P90 14.初步实现自定义的tabBar效果2、 添加 tabBar 代码文件自定义tabBar|微信开发文档:https://developers.weixin.qq.com/miniprogram/dev/framework/ability/custom-tabbar.html在代码根目录下添加入口文件:custom-tab-bar/index.jscustom-tab-bar/index.jsoncustom-tab-bar/index.wxmlcustom-tab-bar/index.wxss3、自定义tabBar标签栏:https://vant-ui.github.io/vant-weapp/#/tabbar在app.json或index.json中引入组件,详细介绍见快速上手。"usingComponents": { "van-tabbar": "@vant/weapp/tabbar/index", "van-tabbar-item": "@vant/weapp/tabbar-item/index"}基础用法<van-tabbar active="{{ active }}" bind:change="onChange"> <van-tabbar-item icon="home-o">标签</van-tabbar-item> <van-tabbar-item icon="search">标签</van-tabbar-item> <van-tabbar-item icon="friends-o">标签</van-tabbar-item> <van-tabbar-item icon="setting-o">标签</van-tabbar-item></van-tabbar>Page({ data: { active: 0, }, onChange(event) { // event.detail 的值为当前选中项的索引 this.setData({ active: event.detail }); },});