camera隐藏后再显示,device-position:“front”失效了
data: {
direction:“front”,
hidden:false
},
reTake:function(){
var that = this
var hiddenTmp = that.data.hidden
if(hiddenTmp){
hiddenTmp=false
}else{
hiddenTmp=true
}
that.setData({
hidden:hiddenTmp
})
},
<camera id=“myCamera” device-position="{{direction}}" flash=“auto” class=‘camera’ hidden="{{hidden}}"></camera>
<button bindtap=‘reTake’>隐藏/显示</button>
求指教