| | |
| | | } |
| | | if (this.lineChart) { |
| | | this.lineChart.setOption(this.option, { notMerge: true }); |
| | | console.log('折线图生成:立即'); |
| | | // console.log('折线图生成:立即'); |
| | | } else { |
| | | this.onChartCreated = () => { |
| | | this.lineChart.setOption(this.option, { notMerge: true }); |
| | |
| | | }, |
| | | mounted() { |
| | | this.lineChart = echarts.init(this.$refs.lineChart); |
| | | setTimeout(() => { |
| | | if (typeof this.onChartCreated === 'function') { |
| | | this.onChartCreated(); |
| | | console.log('折线图生成:滞后'); |
| | | } |
| | | }, 500); |
| | | this.onChartCreated(); |
| | | // setTimeout(() => { |
| | | // if (typeof this.onChartCreated === 'function') { |
| | | // this.onChartCreated(); |
| | | // // console.log('折线图生成:滞后'); |
| | | // } |
| | | // }, 500); |
| | | } |
| | | }; |
| | | </script> |