小程序我所遇到的问题

小程序

导航栏需要修改时,

去pages.json找到需要修改的页面路径;如:

{
//需要修改的路径
"path": "PatrolTask/PatrolTaskIndex",
	"style": {
		//导航栏标题
		"navigationBarTitleText": "巡查任务",
		//下拉刷新
		"enablePullDownRefresh": false,
		//添加这个属性就好了,更多的看微信开发文档
		//设置导航栏样式
		"navigationStyle": "custom"
		}
}

获取微信胶囊的位置信息

在这里插入图片描述
使用这段代码就好了

	data() {
			return {
				widthNum: 0,
				heightNum: 0,
				TopNum: 0,
			};
		},
	onLoad(options) {
			// 获取微信胶囊的位置信息 width,height,top,right,left,bottom
			const custom = wx.getMenuButtonBoundingClientRect()
			console.log(custom, "custom")
			this.widthNum = custom.width;
			this.heightNum = custom.height;
			this.TopNum = custom.top;
		},

小程序传参
传对象不行可以需要进行转义用json.stringify(Object) 把对象进行转换
在这里插入图片描述
在接受页面中 用JSON.parse() 就可以了

onLoad(option) {
	this.item = JSON.parse(option.item);
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值