uniapp常用配置

12 篇文章 1 订阅

一、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"
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
uniapp常用模板包括以下几个: 1. [uniapp开发基础模板](https://gitee.com/gefucai/uniapp-template.git): 这个模板是一个基础的uniapp开发模板,可以作为起点来快速搭建uniapp项目。 2. [uni-app 初始模板](https://uniapp.dcloud.io/quickstart?id=%e5%88%9d%e5%a7%8b%e5%8c%96%e5%ae%89%e8%a3%85): 这个模板是官方提供的初始模板,具有一些功能特性,例如引入UI框架、网络请求库、vuex状态管理等,可以通过使用方式创建uniapp项目。 3. [uniapp基础开发模板](https://github.com/zhaomenghuan/uniapp-template): 这个模板对uniapp的请求进行了简单封装,实现了请求拦截和响应处理,并引用了uView2.0封装的http请求,可以通过配置来切换使用不同的请求库。 以上是uniapp常用的模板,它们提供了一些基础功能和工具,可以帮助开发者快速构建uniapp应用。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [uniapp基础开发模板](https://blog.csdn.net/zx_001/article/details/124460155)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [uni-app_base:uni-app uniapp项目初始化模板,集成常用功能和配置,持续完善中..](https://download.csdn.net/download/weixin_42116805/18637367)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值