uniapp常用配置

Posted GHUIJS

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了uniapp常用配置相关的知识,希望对你有一定的参考价值。

一、app打包后分离手机状态栏

 "app-plus" : {
        "statusbar" : {
            "immersed" : false
        }
}

二、表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持

"app-plus" : {
        "compatible" : {
            "ignoreVersion" : true  
        }
}

三、页面下拉刷新

{
	"path": "pages/index/index",
	"style": {
		"navigationBarTitleText": "首页",
		"enablePullDownRefresh":true
	}
}

四、底部导航配置

"tabBar": {
	"custom": true,
	"fontSize": "14px",
	"color": "#7A7E83",
	"selectedColor": "#58C1EF",
	"borderStyle": "black",
	"backgroundColor": "#ffffff",
	"list": [{
		"pagePath": "pages/index/index",
		"iconPath": "static/image/tab-bar-icon/shouy.png",
		"selectedIconPath": "static/image/tab-bar-icon/shouy_act.png",
		"text": "首页"
	}, {
		"pagePath": "pages/equipment/equipment",
		"iconPath": "static/image/tab-bar-icon/sheb.png",
		"selectedIconPath": "static/image/tab-bar-icon/sheb_act.png",
		"text": "设备"
	}, {
		"pagePath": "pages/personnel/personnel",
		"iconPath": "static/image/tab-bar-icon/reny.png",
		"selectedIconPath": "static/image/tab-bar-icon/reny_act.png",
		"text": "人员"
	}, {
		"pagePath": "pages/earnings/earnings",
		"iconPath": "static/image/tab-bar-icon/shoy.png",
		"selectedIconPath": "static/image/tab-bar-icon/shoy_act.png",
		"text": "收益"
	}]
}

五、开发环境与打包环境判断

let APP_SERVER_URL = ""

if(process.env.NODE_ENV === 'development'){
    // 开发环境
    // APP_SERVER_URL = 'http://192.168.0.5:8082'
    // APP_SERVER_URL = 'http://192.168.0.9:8082'
}else{
    // 生产环境
    APP_SERVER_URL = 'https://**.***.com/***/'
}

export default APP_SERVER_URL

六、去除uniapp原生导航

"globalStyle": {
	"navigationStyle": "custom",
	"app-plus": {
		"titleView": false
	}
}

七、改变原生导航字体颜色,背景

"globalStyle": {
	"navigationBarTextStyle": "black",
	"navigationBarTitleText": "uni-app",
	"navigationBarBackgroundColor": "#F8F8F8",
	"backgroundColor": "#f2f2f2"
}

以上是关于uniapp常用配置的主要内容,如果未能解决你的问题,请参考以下文章

微信小程序海报 uniapp

微信小程序海报 uniapp

有问必答搭建uniapp项目流程手把手教学

配置 VScode 编辑器 (前端篇)

uniapp查看Andriod版本及相关配置

[AndroidStudio]_[初级]_[配置自动完成的代码片段]