思路:在点击某个遮罩或者弹框时,改变data里定义的Showhiddenunits等于true,watch监听对图表进行隐藏和现实。
data() {
return {
Showhiddenunits:false,
showCanvas: true,
}
}
<qiun-data-charts
:style="!showCanvas?'display:none':''"
:type="linetype"
:chartData="lineOptsect"
background="none"
:ontouch="true"
canvasId="Drawingboardid"
:canvas2d="true"
/>
watch: {
Showhiddenunits(newValue, oldValue){
this.showCanvas = !newValue
},
},
经过测试非常好用!