update 设备产量时序图

This commit is contained in:
lb
2023-09-20 15:17:29 +08:00
parent 8ad84a4d61
commit c600d14f8f
2 changed files with 126 additions and 55 deletions

View File

@@ -21,7 +21,14 @@ export default {
chart: null,
};
},
computed: {},
watch: {
config: {
handler(value) {
if (value != null) this.setOption(value);
},
deep: true,
},
},
mounted() {
this.init();
},
@@ -32,9 +39,11 @@ export default {
},
methods: {
init() {
console.log('thsi el', this.$el);
if (!this.chart) this.chart = echarts.init(this.$el);
this.chart.setOption(this.config);
this.setOption(this.config);
},
setOption(option) {
if (this.chart) this.chart.setOption(option);
},
},
};