uni-app 動(dòng)態(tài)設(shè)置頁(yè)面標(biāo)題
uni.setNavigationBarTitle({
title:這里是動(dòng)態(tài)標(biāo)題內(nèi)容
})?
view頁(yè)面中使用這個(gè)? ? 獲取系統(tǒng)信息同步接口。
來(lái)獲取高度或?qū)挾戎苯痈淖僾iew的寬度或高度有效果
const res = uni.getSystemInfoSync(); console.log(res.model); console.log(res.pixelRatio); console.log(res.windowWidth); console.log(res.windowHeight); console.log(res.language); console.log(res.version); console.log(res.platform);
uniapp獲取上一個(gè)頁(yè)面地址
var pages = getCurrentPages(); // 當(dāng)前頁(yè)面
var beforePage = pages[pages.length - 2]; // 前一個(gè)頁(yè)面
// console.log(beforePage);
wx.navigateBack({
? ? success: function() {
? ? ? ? beforePage.onLoad(); // 執(zhí)行前一個(gè)頁(yè)面的onLoad方法
? ? }
});