当前位置:网站首页>uniapp pages.json Simple application
uniapp pages.json Simple application
2022-08-07 22:41:00 【Little___Turtle】
目录
代码演示 官网详细介绍 Download icon ali gallery images
pages.json 配置页面样式
pages.json文件用来对 uni-app 进行全局配置,决定页面文件的路径、窗口样式、原生的导航栏、底部的原生tabbar 等.

pages
uni-app 通过 pages 节点配置应用由哪些页面组成,pages 节点接收一个数组,数组每个项都是一个对象,其属性值如下:
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| path | String | 配置页面路径 | |
| style | Object | 配置页面窗口表现,配置项参考下方 pageStyle |
Tips:
- pages节点的第一项为应用入口页(即首页)
- 应用中新增/减少页面,都需要对 pages 数组进行修改
- 文件名不需要写后缀,框架会自动寻找路径下的页面资源
代码演示 style更多样式
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
// Navigation title content
"navigationBarTitleText": "首页",
//导航背景颜色
"navigationBarBackgroundColor": "#ff5566",
//导航标题颜色 Support only white 黑
"navigationBarTextStyle": "white",
//是否开启下拉刷新
"enablePullDownRefresh": true
}
}
,{
"path" : "pages/login/login",
"style" :
{
"enablePullDownRefresh": false
}
}
]运行效果

globalStyle
用于设置应用的状态栏、导航条、标题、窗口背景色等.
全局通用 If you have any style according to the local show local
代码演示 More variety show
"globalStyle": {
// 导航栏标题颜色
"navigationBarTextStyle": "black",
//导航栏标题内容
"navigationBarTitleText": "default",
//导航栏背景颜色
"navigationBarBackgroundColor": "#F8F8F8",
//导航栏背景颜色
"backgroundColor": "#F8F8F8"
},运行效果

tabBar
如果应用是一个多 tab 应用,可以通过 tabBar 配置项指定一级导航栏,以及 tab 切换时显示的对应页.
- tabBar 中的 list 是一个数组,只能配置最少2个、最多5个 tab,tab 按数组的顺序排序.
代码演示 官网详细介绍 Download icon ali gallery images
"tabBar": {
//背景颜色
"backgroundColor": "#F8F8F8",
//tab文字颜色
"color": "#d8d8d8",
//tab选中文字颜色
"selectedColor": "#444",
"list": [
{
"text": "首页",
//页面路径 该路径与pages一致 Or show not to come out
"pagePath": "pages/index/index",
//默认展示图片
"iconPath": "./static/icon/index.png",
//Selected display pictures
"selectedIconPath": "./static/icon/indexSel.png"
},
{
"text": "个人",
"pagePath": "pages/homepage/homepage",
"iconPath": "./static/icon/person.png",
"selectedIconPath": "./static/icon/personSel.png"
}
]
},运行效果

边栏推荐
- 那就浅浅回顾一下生成器吧
- 测试/开发程序员为什么这么吃香,高薪的“孤独症患者“......
- 流式计算中的 Window 计算
- Open3D点云转二值图
- Expansion of the Unity editor - Scene view custom operations
- 对于人性的理解
- CSRF漏洞
- 同花顺开户靠谱吗?开户安全吗
- The 2019 ICPC Asia Nanjing Regional Contest(A、C、K)
- Google and universities released the end-to-end panoramic segmentation method MaX-DeepLab, which greatly reduces the artifacts of image segmentation and does not contain manual modules
猜你喜欢

Unity editor extension -- custom Window extension

UE4 Sequence添加基础动画效果 (01-物体移动)

Leecode-SQL 1393. 股票的资本损益

7zip自带hash校验功能

Application of Matlab in 3D Vision 01 Display PCD point cloud

JDBC简介

Leecode-SQL 1407. Top Traveler

The Unity editor development, Project development

buu web部分wp
![[笔记]机器学习之机器学习理论及案例分析《二》 聚类](/img/92/cbb133e7f016346774b5d08c0c219f.png)
[笔记]机器学习之机器学习理论及案例分析《二》 聚类
随机推荐
Google and universities released the end-to-end panoramic segmentation method MaX-DeepLab, which greatly reduces the artifacts of image segmentation and does not contain manual modules
知乎高赞:拼多多和国家电网,选哪个?
图数据建模图数据建模指南
UE4 Sequence添加基础动画效果 (01-物体移动)
Leecode-SQL 1393. Capital Gains and Losses on Stocks
【CNN记录】pytorch gather函数
The 2019 ICPC Asia Nanjing Regional Contest(A、C、K)
那就浅浅回顾一下生成器吧
Unity编辑器拓展--自定快捷键拓展
How to read ten thousand lines of code
unity-单例模式
SQL DNSlog注入详解
Redis - Linux系统安装redis服务并启动
Unity编辑器拓展--预览窗口拓展
Unity编辑器拓展--Hierarchy拓展
nifi配置mysql_binlog读取
《论文解读》THE CURIOUS CASE OF NEURAL TEXT DeGENERATION
多线程七夕特别版(二)互斥锁-死锁-等待通知机制
谷歌联合高校发布端到端的全景分割方法MaX-DeepLab,图像分割的伪影大幅减少且不含手动模块
[论文笔记] A Comprehensive Study on Learning-Based PE Malware Family Classification Methods