小程序做相机方向切换,第一次的切换的时候在真机上会卡屏?
[代码]<[代码][代码]camera[代码] [代码]wx:elif[代码][代码]=[代码][代码]"{{isCameraFont}}"[代码] [代码]flash[代码][代码]=[代码][代码]"off"[代码] [代码]class[代码][代码]=[代码][代码]"camera"[代码] [代码]device-position[代码][代码]=[代码][代码]"front"[代码] [代码]binderror[代码][代码]=[代码][代码]"error"[代码] [代码]bindinitdone[代码][代码]=[代码][代码]"onCameraInitDone"[代码][代码]></[代码][代码]camera[代码][代码]>[代码][代码]<[代码][代码]camera[代码] [代码]wx:elif[代码][代码]=[代码][代码]"{{!isCameraFont}}"[代码] [代码]flash[代码][代码]=[代码][代码]"off"[代码] [代码]class[代码][代码]=[代码][代码]"camera"[代码] [代码]device-position[代码][代码]=[代码][代码]"back"[代码] [代码]binderror[代码][代码]=[代码][代码]"error"[代码] [代码]bindinitdone[代码][代码]=[代码][代码]"onCameraInitDone"[代码][代码]></[代码][代码]camera[代码][代码]>[代码] [代码]<[代码][代码]cover-image[代码] [代码]class[代码][代码]=[代码][代码]"device-position-change-btn"[代码] [代码]src[代码][代码]=[代码][代码]"../../image/ic-camera.png"[代码] [代码]bindtap[代码][代码]=[代码][代码]"changeDevicePosition"[代码][代码]></[代码][代码]cover-image[代码][代码]>[代码] [代码]changeDevicePosition(){[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]isCameraFont: ![代码][代码]this[代码][代码].data.isCameraFont[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码]功能就是点击翻转的按钮可以更改摄像头的方向,但是第一次从翻转camera组件会卡住,请看图片:[图片]