vue 判断手机横竖屏
2022-07-25 本文已影响0人
程序猿的小生活
var widtha = window.screen.width;
var heightb= window.screen.height;
if(widtha>heightb){
alert("横屏")
}else{
alert("竖屏")
}
var widtha = window.screen.width;
var heightb= window.screen.height;
if(widtha>heightb){
alert("横屏")
}else{
alert("竖屏")
}