/**
* 获取屏幕的属于哪种屏幕
* @returns {string} xs 为超小屏 sm 为小屏 md 为中屏 lg 为大屏
*/
export let getScreen = function () {if(win.matchMedia("(min-width: 1200px)").matches) {return 'lg';}else if(win.matchMedia("(min-width: 992px)").matches) {// screen and (min-width: 992px)
return 'md'
}else if(win.matchMedia("(min-width: 768px)").matches) {// screen and (min-width: 768px)
return 'sm'
}else {return 'xs' // 超小屏幕}
}
地址:链接地址