Vue项目 移动端禁止页面放大缩小
在安卓上可以实现禁止放大缩小,但是ios就不行
// index.html 中添加 meta 标签<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover, user-scalable=0">
查询才知道对于IOS10以上的苹果机子,上述方法是行不通的,可以尝试以下的方法
//在 src / app.vue 中 script 标签内添加代码<script>window.onload = function() {document.addEventListener('touchstart', function(e) {console.log("1",e.touches.length)if (e.touches.length > 1) {e.preventDefault()}})document.addEventListener('gesturestart', function(e) {console.log("2")e.preventDefault()})}</script>