1.IOS系统在微信环境下不自动播放音频在vue环境下,可以使用以下测试尝试setTimeout(()=>{constev=newCustomEvent('WeixinJSBridgeReady')document.dispatchEvent(ev)},5000)this.$nextTick(()=>{document.addEventListener('WeixinJSBridgeReady',()=>{document.querySelector('audio').play()},false)})2.画布模糊问题由于画布的大小限制,画布被拉伸,画布被放大,画布的大小高清屏下canvas很小,类似于放大图片导致模糊//获取像素比例context.webkitBackingStorePixelRatio||context.mozBackingStorePixelRatio我||上下文.msBackingStorePixelRatio||上下文.oBackingStorePixelRatio||上下文.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/backingStore;};//绘制文本letmyCanvas=document.querySelector("#my_canvas");letcontext=myCanvas.getContext("2d");letratio=getPixelRatio(context);myCanvas.style.width=myCanvas.width+'px';myCanvas.style.height=myCanvas.height+'px';myCanvas.width=myCanvas.width*ratio;myCanvas.height=myCanvas.height*ratio;//放大倍率context.scale(ratio,ratio);3.ios表单输入框页面在输入框丢失时会上推不反弹添加聚焦时事件el.scrollIntoViewIfNeeded(true)4.iosinputtype=numberinvalid解决方法添加pattern="[0-9]*"attributetoinput5.ios绑定事件时失败问题ios有这样的设置:对于被点击的对象,它有cursor:pointer样式设置,也就是说当鼠标放在上面时,“手”图标可以认为可以使用点击事件解决方法:给元素添加cursor:pointer6.ios动画暂停播放无效animation-play-state在ios中下无效曲线救国
