<template
>
<div
class='s-c'>
<div
class='s-chart' ref
='map'>
</div
>
</div
>
</template
>
<script
>
export default {
name
:'trender',
data(){
return{
myMap
:null,
data
:[]
}
},
mounted()
{
this._initChart();
this._getData();
window
.onresize
=this._resize
;
this._resize();
},
destroyed()
{
window
.removeEventListener('resize',this._resize
);
},
methods
:{
_initChart()
{
this.myMap
=this.$echarts
.init(this.$refs
.map
);
const option
={
};
this.myMap
.setOption(option
);
},
async _getData()
{
this._updateChart();
},
_updateChart()
{
const option
={
};
this.myMap
.setOption(option
);
},
_resize()
{
let container
= this.$refs
.map
.offsetWidth
;
const option
={
};
this.myMap
.setOption(option
);
this.myMap
.resize();
}
}
}
</script
>
<style lang
='less' scoped
>
.s
-c
{
width
: 100%;
height
:100%;
.s
-chart
{
width
: 100%;
height
:100%;
}
}
</style
>
转载请注明原文地址: https://lol.8miu.com/read-20637.html