小程序
导航栏需要修改时,
去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);
}