|
@@ -72,7 +72,7 @@ export default {
|
|
|
methods: {
|
|
|
initChart(value, index) {
|
|
|
var currColor = this.colors[index % 2];
|
|
|
- var $dom = document.getElementById(this.id + (index + 1));
|
|
|
+ var $dom = document.getElementById((this.id + (index + 1)));
|
|
|
$dom.style.width = this.width;
|
|
|
$dom.style.height = `calc(${this.height} / ${this.list.length} - 4px)`;
|
|
|
let chart = echarts.init($dom);
|
|
@@ -295,7 +295,11 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
updated() {
|
|
|
- this.initChart();
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.list.forEach((value, index) => {
|
|
|
+ this.initChart(value, index);
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
};
|
|
|
</script>
|