You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
521 B

export default {
template: "<div></div>",
mounted() {
this.chart = echarts.init(this.$el);
this.chart.setOption(this.options);
this.chart.resize();
},
beforeDestroy() {
this.destroyChart();
},
beforeUnmount() {
this.destroyChart();
},
methods: {
update_chart() {
if (this.chart) {
this.chart.setOption(this.options);
}
},
destroyChart() {
if (this.chart) {
this.chart.dispose();
}
},
},
props: {
options: Object,
},
};