fix:scEcharts组件完善
This commit is contained in:
parent
4d414f1fcf
commit
5c43ebba31
|
@ -3,6 +3,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { markRaw } from 'vue';
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts';
|
||||||
import T from './echarts-theme-T.js';
|
import T from './echarts-theme-T.js';
|
||||||
echarts.registerTheme('T', T);
|
echarts.registerTheme('T', T);
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
if(that.myChart!==null){
|
if(that.myChart!==null){
|
||||||
that.myChart.setOption(v);
|
that.myChart.setOption(v);
|
||||||
}else{
|
}else{
|
||||||
let myChart = echarts.init(that.$refs.scEcharts, 'T');
|
let myChart = markRaw(echarts.init(that.$refs.scEcharts, 'T'));
|
||||||
myChart.setOption(v);
|
myChart.setOption(v);
|
||||||
that.myChart = myChart;
|
that.myChart = myChart;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +63,7 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
draw(){
|
draw(){
|
||||||
var myChart = echarts.init(this.$refs.scEcharts, 'T');
|
var myChart = markRaw(echarts.init(this.$refs.scEcharts, 'T'));
|
||||||
myChart.setOption(this.myOptions);
|
myChart.setOption(this.myOptions);
|
||||||
this.myChart = myChart;
|
this.myChart = myChart;
|
||||||
window.addEventListener('resize', () => myChart.resize());
|
window.addEventListener('resize', () => myChart.resize());
|
||||||
|
|
Loading…
Reference in New Issue