{
"path": "pages/index/index2",
"style": {
"navigationBarTitleText": "demo",
"enablePullDownRefresh": true,
"app-plus":{
"titleNView": {
"buttons": [ //原生标题栏按钮配置,
{
"type":"none",
"text": "位置",
"fontSize": "17",
"float":"left",
"width": "70",
"select": "true"
},
{
"type":"none",
"float": "right",
"fontSrc":"/static/iconfont.ttf",
"text": "\ue69a"
}
]
}
}
}
},
- 发布:2019-05-18 11:53
- 更新:2019-06-27 10:31
- 阅读:2975
90后菜鸟 (作者) - 90后
// #ifdef APP-PLUS
let pages = getCurrentPages()
let page = pages[pages.length - 1]
let currentWebview = page.$getAppWebview()
let titleObj = currentWebview.getStyle().titleNView
// this.addressName 位置
titleObj.buttons[0].text = this.addressName
currentWebview.setStyle({
titleNView:titleObj
})
// #endif
ok了,问题已经解决了
90后菜鸟 (作者) - 90后
getRegeo() {
this.amapPlugin.getRegeo({
success: res => {
this.addressName = res[0].regeocodeData.addressComponent.district;
console.log(this.addressName);
// #ifdef APP-PLUS
let pages = getCurrentPages();
let page = pages[pages.length - 1];
let currentWebview = page.$getAppWebview();
let titleObj = currentWebview.getStyle().titleNView;
// this.addressName 位置
titleObj.buttons[0].text = this.addressName;
currentWebview.setStyle({
titleNView: titleObj
});
// #endif
}
});
},
loquy
$getAppWebview is not a function
2019-06-15 12:04