JS判断是安卓还是IOS

 //判断是IOS还是安卓  docPros
    appSource() {
            const u = navigator.userAgent;
            const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
            if (isiOS) {
        // this.$utils.msgshow('ios')
        this.$refs.docPros.style.bottom='-0.03rem'
            } else {
        // this.$utils.msgshow('安卓')
        this.$refs.docPros.style.bottom='0.03rem'
            }
        },

猜你喜欢

转载自www.cnblogs.com/fkcqwq/p/13187865.html
今日推荐