uni-app 各种常用设置

uni-app 修改原生导航自定义按钮样式

setTitleNViewButtonStyle:function(){
  this.btnStatus = !this.btnStatus;
	// #ifdef APP-PLUS
	var webView = this.$mp.page.$getAppWebview();
	webView.setTitleNViewButtonStyle(0, {  
		text: this.btnStatus ?'编辑':'完成', 
		color:this.btnStatus ?'#479dfd':'#ce2a21'
	}); 
	// #endif		
},

uni-app ios禁止侧滑(滑屏)返回

"app-plus": {
	"popGesture": "none",// 禁止ios侧滑返回
	"bounce": "none",
	"titleNView": {
	"autoBackButton":"false",
	"backgroundColor": "#fff",
	"buttons": [{
		"text": "帮助",
		"fontSize": "16"
	  }
	]
  }
}

uni-app 传递对像到子页面

let detail = {
	author_name: e.author_name,
	cover: e.cover,
	id: e.id,
	ost_id: e.post_id,
	published_at: e.published_at,
	title: e.title
	};
uni.navigateTo({
url: '../../pageName?detailDate=' + encodeURIComponent(JSON.stringify(detail))
);

你可能感兴趣的:(uni-app)