vue 判断设备是Android 还是 IOS
2019-08-20 本文已影响0人
路尔轩
appSource() {
const u = navigator.userAgent;
const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if (isiOS) {
return "ios";
} else {
return "andriod";
}
},
appSource() {
const u = navigator.userAgent;
const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if (isiOS) {
return "ios";
} else {
return "andriod";
}
},