Android
mounted() { window.onresize = () => { if (this.domHeight > document.documentElement.clientHeight) {
// 获取焦点 this.focus = true; } else {
// 失去焦点
this.focus = false; } }; }
ios
window.addEventListener("focusin", () => { // 获取焦点 this.focus = true; }); window.addEventListener("focusout", () => { // 失去焦点 this.focus = false; });
isIOS() { return /(iPhone|iPad|iPod|iOS)/gi.test(navigator.userAgent) }, isAndroid() { return /(Android)/i.test(navigator.userAgent) },