}
},
// 自适应大小
isUpdate() {
if (this.chart) {
this.chart.resize()
}
}
},
data() {
return {
chart: null
}
},
mounted() {
this.initChart()
},
methods: {
initChart() {
this.chart = markRaw(echarts.init(this.$el, ‘dark’)) //获取自身dom元素
// this.chart = echarts.init(this.$el, ‘dark’)
if (this.option.type != ‘default’) {
this.chart.setOption(this.option)
}
}
}
}