mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-09-24 04:39:21 +08:00
首页图表宽度自适应
This commit is contained in:
@@ -29,8 +29,10 @@
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initChart()
|
this.initChart()
|
||||||
|
window.addEventListener('resize', this.listenerResize);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
window.removeEventListener('resize', this.listenerResize)
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
chartData:{
|
chartData:{
|
||||||
@@ -41,6 +43,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
listenerResize() {
|
||||||
|
this.chart.resize();
|
||||||
|
},
|
||||||
initChart() {
|
initChart() {
|
||||||
this.chart = echarts.init(this.$el)
|
this.chart = echarts.init(this.$el)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user