放在watch方法中观察数据源变化进行图表数据设置即可
//观察data的变化 seriesData: { handler (newVal, oldVal) { this.charts = echarts.init(document.getElementById('monitorTendencyChartCont')); if (this.charts) { for (let i = 0; i < this.seriesData.length; i++) { if (oldVal[i] !== newVal[i]) { let option = { title: { text: this.seriesData.length>0?"":"暂无数据", x: 'center', y: 'center', textStyle: { color: '#909399', fontWeight: 'normal', fontSize: 16 } }, tooltip: {//提示框 trigger: 'axis'//触发类型--组 }, grid: { show: true, top: '6%', left: 32, right: 32, bottom: '15%', containLabel: true,