uni-app 修改原生导航自定义按钮样式
setTitleNViewButtonStyle:function(){
this.btnStatus = !this.btnStatus;
var webView = this.$mp.page.$getAppWebview();
webView.setTitleNViewButtonStyle(0, {
text: this.btnStatus ?'编辑':'完成',
color:this.btnStatus ?'#479dfd':'#ce2a21'
});
},
uni-app ios禁止侧滑(滑屏)返回
"app-plus": {
"popGesture": "none",
"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 vue3+vite+ts 图片转base64
const setImage = (e : any) => {
uni.compressImage({
src: e.path,
quality: 10,
success: res => {
plus.io.resolveLocalFileSystemURL(res.tempFilePath, function (entry) {
entry.file(function (file) {
var fileReader = new plus.io.FileReader()
fileReader.readAsDataURL(file)
fileReader.onload = function (evt) {
let image_base64 = evt.target.result,e.id ;
}
})
})
}
})
}