uni-app 动态修改标题栏按钮名称

onReady() {
    let buttons = '按钮'
    //buttons = '\ue670' 如果是字体图标需要引入ttf文件

    // #ifdef APP-PLUS
    var currentWebview = this.$mp.page.$getAppWebview();
    console.log(currentWebview)
    var tn = currentWebview.getStyle().titleNView;   
    tn.buttons[0].text = buttons;     //[0] 按钮的下标
    currentWebview.setStyle({  
    titleNView: tn  
    });
// #endif
}

  

猜你喜欢

转载自www.cnblogs.com/lymconch/p/11286823.html