src/pages/shuohuangMonitorAnalyze/components/charts/line.vue
@@ -1,5 +1,5 @@ <template> <div ref="lineChart"></div> <div ref="lineChart" :style="{width:defineW+'px',height:defineH+'px'}"></div> </template> <script> @@ -7,14 +7,22 @@ props: { options: { type: Object }, defineW: { type: Number, default: 600, }, defineH: { type: Number, default: 300, } }, mounted(){ mounted () { this.initLineChart(); }, methods:{ initLineChart(){ this.$$nextTick(()=>{ methods: { initLineChart () { this.$nextTick(() => { let dom = this.$echarts.init(this.$refs['lineChart']); dom.setOption(this.options); })