echarts碰到el-tabs首次加载echarts宽度只有100px
1.不要在mounted钩子函数里面调用绘制echarts
mounted() {this.initEcharts();},
2.在切换tabs里面的函数里面调用绘制echarts
<el-tabs v-model="activeTab" class="panel-tabs" @tab-click="handleTabClick"><el-tab-pane :label="$t('h.总览')" name="overview" /><el-tab-pane :label="$t('h.图表')" name="telemetry" /></el-tabs>handleTabClick(tab) {console.log(tab.label);if (tab.label === "telemetry") {this.startTelemetryPolling();this.initEcharts();} else {}