Vue 屏幕的限制

export default {
    getScreen: function () {
        var width = document.body.clientWidth;
        if (width >= 1200) {
            return 3; //大屏幕
        } else if (width >= 992) {
            return 2; //中屏幕
        } else if (width >= 768) {
            return 1; //小屏幕
        } else {
            return 0; //超小屏幕
        }
    }
}
工作中如果有您解决不了的问题或者您花费2小时还没解决的问题,这里可以有偿帮您高效直接解决bug,wx号:18062748486,备注”bug解决“;

posted on 2022-05-18 12:02  艾小码  阅读(64)  评论(0编辑  收藏  举报

导航