当前位置:网站首页>uniapp中设置tabBar及其窗口标题
uniapp中设置tabBar及其窗口标题
2022-08-11 05:17:00 【肖肖冲鸭】
在微信小程序中,我们设置tabBar是在全局的pages.json中设置,窗口标题是在每个页面的单独的pages.json中设置
但是在uniapp找那个与微信小程序有所不同,它每个页面没有单独的pages.json文件,我们应该在全局的pages.json中每个页面的路径下的style标签下设置样式
{
"globalStyle" : {
"navigationBarTextStyle" : "white",
"navigationBarTitleText" : "仿网易商城",
"navigationBarBackgroundColor" : "#BB2C08"
},
"uniIdRouter" : {
},
"pages" : [
{
"path" : "pages/index/index",
"style" : {
"enablePullDownRefresh" : false
}
}
,{
"path" : "pages/category/category",
"style" :
{
"navigationBarTitleText": "分类",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/cart/cart",
"style" :
{
"navigationBarTitleText": "购物车",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/personal/personal",
"style" :
{
"navigationBarTitleText": "个人中心",
"enablePullDownRefresh": false
}
}
],
"tabBar": {
"color": "#555",
"selectedColor": "#D43C33",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "/static/images/tabBar/tab-home.png",
"selectedIconPath": "/static/images/tabBar/tab-home-current.png"
},
{
"pagePath": "pages/category/category",
"text": "分类",
"iconPath": "/static/images/tabBar/tab-cate.png",
"selectedIconPath": "/static/images/tabBar/tab-cate-current.png"
},
{
"pagePath": "pages/cart/cart",
"text": "购物车",
"iconPath": "/static/images/tabBar/tab-cart.png",
"selectedIconPath": "/static/images/tabBar/tab-cart-current.png"
},
{
"pagePath": "pages/personal/personal",
"text": "个人中心",
"iconPath":"/static/images/tabBar/tab-my.png",
"selectedIconPath": "/static/images/tabBar/tab-my-current.png"
}
]
}
}
边栏推荐
猜你喜欢
随机推荐
吃瓜教程task01 第2章 模型评估与选择
uniapp获取用户信息(登录及个人中心页面的实现)
C语言——动态内存分配常见的错误案例
第二篇 DS5 Armv8 样例工程报错之GCC编译
RK3399上的Tengine实践笔记
08-JS对象、原型及原型链
吃瓜教程task03 第4章 决策树
设计三级联动
pytorch矩阵运算问题
性能效率测试
06-JS定时器:间隔定时器、延时定时器
C语言学习记录--变量基本类型和内存大小
2021研究生数学建模D题,BP神经网络和卷积神经网络解题代码(基于pytorch)
【C语言从初阶到进阶】第二篇 初始C语言(二)
bootstarp作业一:制作分页器
[Verilog] I2S Master Test Bench
第5章 循环和关系表达式
ClionIDE compiles by specifying the compiler
Chapter 13 Class Inheritance-1
Chapter 13 Class Inheritance