vue 爬坑之路----flexible.js不适配ipad和ipad pro

在vue的项目初建过程中,使用了flexible.js,发现不兼容ipad以及iPadpro,各种查了资料,要在代码里面加入判断什么的,因为是不太熟悉,不知道到底在哪个位置添加,后来想了想,直接在html页面中添加就可以了,整个vue项目只有一个index.html的html文件页面,所以,到这里添加就是最好的了啦。~~

    <script>
      // 用于适配ipad以及ipad pro
      ;/(iPhone|iPad|iPhone OS|Phone|iPod|iOS)/i.test(navigator.userAgent) &&
        ((head = document.getElementsByTagName('head')),
        (viewport = document.createElement('meta')),
        (viewport.name = 'viewport'),
        (viewport.content =
          'target-densitydpi=device-dpi, width=480px, user-scalable=no'),
        head.length > 0 && head[head.length - 1].appendChild(viewport))
    </script>

猜你喜欢

转载自www.cnblogs.com/liuguoying/p/10966237.html