项目是用uniCloud admin做的一个后台项目,运行在pc浏览器上的,用的是360极速。
canvas 的 @touchstart @touchmove @touchend都无法执行。
但是浏览器控制台将设备更改成移动设备canvas 的 @touchstart @touchmove @touchend就能够执行。  
代码
<canvas   
    class="canvas"  
    type="2d"   
    canvas-id="canvas"  
    @touchstart="touchStart"  
    @touchmove="touchMove"  
    @touchend="touchEnd"  
    @error="error"  
></canvas>  
methods: {  
    touchStart(e) {  
        console.log('start')  
    },    
    touchMove(e) {  
        console.log('move')  
    },  
    touchEnd(e) {  
        console.log('end')  
    }  
} 
             
             
             
			 
                                        
                                     
            
2 个回复
深海智行 - 专注前端培训
我测试了我的surface pro是可以支持的,你确定你的设备有触摸屏吗?如果没有可以使用原始鼠标事件。
1***@qq.com
我这是 H5 端 canvas 没有touch响应事件