echartd 设置隐藏div属性不生效 再展示时是空白得问题
点击显示按钮置为true了都不行 div下就只有echarts显示空白。
解决:需重新加载echarts,且需要加上this.$nextTick
完整代码如下:
showEcharts() {
console.log('打开关闭echarts', this.showEchart)
this.showEchart = !this.showEchart
if (this.showEchart === true) {
this.$nextTick(() => {
this.myEcharts()// 初始化
})
}
console.log('点击后值为', this.showEcharts)
},