1 <script> 2 export default { 3 onReady() { 4 // 已渲染 5 var pages = getCurrentPages(); 6 var page = pages[pages.length - 1]; 7 8 // #ifdef H5 9 document.querySelector('.uni-page-head-ft .uni-page-head-btn .uni-btn-icon').innerHTML = '新文字'; 10 // #endif 11 12 // #ifdef APP-PLUS 13 var currentVebview = page.$getAppWebview(); 14 var tn = currentVebview.getStyle().titleNView; 15 tn.buttons[0].text = '新文字 \ue001'; // \ue... 字体图标 16 tn.buttons[0].fontSrc = "/static/font/iconfont.ttf" 17 currentVebview.setStyle({ 18 titleNView: tn 19 }) 20 // #endif 21 } 22 } 23 </script>
官网参考:
https://uniapp.dcloud.net.cn/tutorial/page.html#getappwebview
https://www.html5plus.org/doc/zh_cn/webview.html#plus.webview.WebviewObject
标签:uniapp,APP,H5,tn,PLUS,currentVebview,var,titleNView,page From: https://www.cnblogs.com/myflowers/p/17805611.html