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

Posted lymconch

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

  

以上是关于uni-app 动态修改标题栏按钮名称的主要内容,如果未能解决你的问题,请参考以下文章