setDocumentTitle (title) {
let $body = document.body;
document.title = title;
let $iframe = createDom('<iframe src="/favicon.ico"></iframe>');
$iframe.addEventListener('load', load);
$body.appendChild($iframe);
function load(){
setTimeout(function() {
$iframe.removeEventListener('load', load);
$body.removeChild($iframe);
}, 0);
}
function createDom(htmlStr){
let tmp = document.createElement('div');
tmp.innerHTML = htmlStr;
let children = tmp.childNodes;
for (let i = 0; i < children.length; i++) {
if (children[i].nodeType ===1 ) {
return children[i];
}
}
return;
}
}
if (this.state.Tab) {
document.title = '我的';
} else {
document.title = '你的';
}