问题模块 |
---|
API和组件 |
< canvas canvas-id = "canvas" id = "canvas" > < cover-view id = 'mask' wx:if = '{{show}}' ></ cover-view > </ canvas > < button bindtap = "change" >按钮</ button > |
#mask{ position : absolute ; top : 0 ; left : 0 ; width : 100px ; height : 100px ; background : #333 ; } |
onLoad: function (options) { let ctx=wx.createCanvasContext( 'canvas' ) ctx.setFillStyle( 'red' ) ctx.fillRect(0,0,300,150) ctx.draw() }, change(){ this .setData({ show:! this .data.show }) }, |
上面是简单的代码,在我点击按钮的时候就会显示隐藏那个cover-view标签,问题是我每点击一次都会增加一个<
cover-view
id
=
'mask'
wx:if
=
'{{show}}'
></
cover-view
>这样的标签最后就会跟下图一样,请问这个是官方的bug么?
网友回复
Dseeker:
但是我现在在项目中有碰到这个问题呀,请问能有什么解决方案可以解决这个问题吗
んS:
可能是一个 bug,但现在您可以暂时无需关切它。