项目目录
hybrid有一般用来存放app项目的html文件
platforms用来存放各个平台需要用到的页面
page项目所有的页面都会放到page中
App.vue存放全局的样式,对全局的监听(检测更新,网络更新,初始化数据)等
manifest.json
pages.json
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
//想要那个页面在项目启动时就显示,就配置那个页面的地址
{
"path": "pages/index/index",
"style": {
//配置首页标题
"navigationBarTitleText": "uni-app",
"app-plus": {
// 配置导航栏
"titleNView": {
// 导航栏搜索框
"searchInput": {
"align":"center",
"backgroundColor":"#F5F4F2",
"borderRadius":"4px",
"disabled":true,
"placeholder":"搜索帖子",
"placeholderColor":"#6D6C67"
},
"buttons":[{
"color":"#333333",
"colorPressed":"#FD597C",
"float":"right",
"fontSize":"20px",
"fontSrc":"/static/iconfont.ttf",
//这里不能直接使用unicode 字符表示必须 '\u' 开头,如 "\ue123"(注意不能写成"\e123")
"text":"\ue668"
}]
}
}
}
}
],
//全局的配置
"globalStyle": {
"navigationBarTextStyle": "black",
//配置全局标题,如果单个页面也配置了对应的标题则,用该页面配置的标题
"navigationBarTitleText": "uni-app",
//导航(状态栏)背景颜色
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
}
配置渐变式导航栏
{
"path" : "pages/topic-detail/topic-detail",
"style" :
{
"app-plus": {
"titleNView": {
"type": "transparent",
"buttons": [
{
// 配置右侧三个点菜单
"type": "menu"
}
]
}
}
}
}
页面的下拉刷新
“enablePullDownRefresh”: true
{
"path" : "pages/msg/msg",
"style" :
{
"navigationBarTitleText": "消息列表",
//设置页面的下拉刷新
"enablePullDownRefresh": true,
"app-plus": {
"titleNView": {
"buttons": [
{
"color":"#333333",
"colorPressed":"#FD597C",
"float":"left",
"fontSize":"20px",
"fontSrc":"/static/iconfont.ttf",
"text":"\ue611"
},
{
"color":"#333333",
"colorPressed":"#FD597C",
"float":"right",
"fontSize":"20px",
"fontSrc":"/static/iconfont.ttf",
"text":"\ue649"
}
]
}
}
}
}