camera隐藏后再显示,device-position:“front”失效了
发布于 5 年前 作者 qiangdu 9272 次浏览 来自 问答

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>

求指教

回到顶部