加载一个空的iframe
,触发document
加载事件,使微信webview
重新获取title
export function initTitle(title = "") {
// document.title = title;
var iframe = document.createElement('iframe');
iframe.style.visibility = 'hidden';
iframe.style.width = '1px';
iframe.style.height = '1px';
iframe.onload = function () {
setTimeout(function () {
document.body.removeChild(iframe);
}, 100);
};
document.body.appendChild(iframe);
}