明天的明天 永远的永远 未知的一切 我与你一起承担 ??

是非成败转头空 青山依旧在 几度夕阳红 。。。
随笔 - 1277, 文章 - 0, 评论 - 214, 阅读 - 321万
  博客园  :: 首页  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

Uni-app usingComponents 和自定义导航用法

Posted on   且行且思  阅读(5702)  评论(0编辑  收藏  举报
复制代码
{
    "pages": [{
        "path": "pages/main/main",
        "style": {
            "navigationStyle": "custom",
            "transparentTitle": "auto",
            "titlePenetrate": "YES",
            "navigationBarBackgroundColor": "#0067FF",
            "navigationBarTextStyle": "white",
            "navigationBarTitleText": "",
            "usingComponents": {
                "home-page": "/pages/main/tabs/home/home",
                "client-page": "/pages/main/tabs/business/business",
                "me-page": "/pages/main/tabs/me/me"
            }
        }
    }, {
        "path": "pages/main/tabs/home/home",
        "style": {
            "usingComponents": {
                "cb-page": "/pages/main/tabs/home/cb/cb"
            }
        }
    }, {
        "path": "pages/main/tabs/business/business"
    }, {
        "path": "pages/main/tabs/me/me"
    }, {
        "path": "pages/login/login",
        "style": {
            "navigationBarTitleText": "登录"
        }
    }, {
        "path": "pages/main/tabs/home/cb/cb"
    }],
    "globalStyle": {
        "navigationBarTextStyle": "black",
        "navigationBarTitleText": "标题",
        "navigationBarBackgroundColor": "#F8F8F8",
        "backgroundColor": "#F8F8F8",
        "app-plus": {
            "background": "#efeff4"
        }
    },
    "condition" : { //模式配置,仅开发期间生效
        "current": 0, //当前激活的模式(list 的索引项)
        "list": [
            {
                "name": "", //模式名称
                "path": "", //启动页面,必选
                "query": "" //启动参数,在页面的onLoad函数里面得到
            }
        ]
    }
}
复制代码

 

一、  "navigationStyle": "custom",   //为自定义导航
二、usingComponents ,若引用地址为非 components 目录组件下的,则在 pages.json 需要注册,如:
{
        "path": "pages/main/tabs/home/cb/cb"
    }

否则会提示报找不到 地址

 

相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端
历史上的今天:
2018-09-08 sqlserver查询指定树形结构的所有子节点
点击右上角即可分享
微信分享提示