推荐一个自定义导航栏开源库

发布于 5 年前作者 dingna5624 次浏览最后编辑 5 年前来自 share

前言

大家都知道官方提供的小程序导航栏相对有限,那么我们如何应对产品大大无限的需求呢?

那么肯定就需要自定义导航栏,而今天我要给大家推荐一款很棒的自定义导航栏开源项目。

少啰嗦,看效果。⬇️

看效果

看属性

如何使用?

配置 app.json 中的 navigationStyle 和 usingComponents

{
  "window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#fff",
    "navigationBarTitleText": "自定义导航栏",
    "navigationBarTextStyle": "black",
    "navigationStyle": "custom"
  },
  "usingComponents": {
    "navBar": "/components/navBar/navBar"
  },
  "sitemapLocation": "sitemap.json"
}

页面代码:

 
    

上地址

地址:https://github.com/lingxiaoyi/navigation-bar

1 回复
zhongqiang
zhongqiang1 楼3 年前

建议写个代码片段。能直接运行查看效果。

https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html