兼容mac系统无法修改微信浏览器无法修改页面标题
isApple() {
return navigator.userAgent.indexOf('Mac') > -1 || navigator.userAgent.indexOf('Ios') > -1
}
if (this.isApple) {
const reloadNum = Number(localStorage.getItem('reloadNum'))
if (reloadNum) {
localStorage.removeItem('reloadNum')
location.reload()
} else {
localStorage.setItem('reloadNum', 1)
}
}
document.title = 'xxxx'
if (this.isApple) {
const i = document.createElement('iframe')
i.src = '/favicon.ico' + Math.random() * 1000
i.style.display = 'none'
i.onload = function () {
setTimeout(function () {
i.remove()
}, 9)
}
document.body.appendChild(i)
}