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

时间:2019-08-02 11:06:28   收藏:0   阅读:1237
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
}

  

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!