vue-echarts resize 自适应宽度
<template><chart style="width: 100%; height: 350px"ref="chart1":options="orgOptions":auto-resize="true"></chart></template>methods: {resizeTheChart () {if (this.$refs &&
·
<template>
<chart style="width: 100%; height: 350px"
ref="chart1"
:options="orgOptions"
:auto-resize="true"></chart>
</template>
methods: {
resizeTheChart () {
if (this.$refs && this.$refs.chart1) {
this.$refs.chart1.resize();
}
}
},
mounted () {
this.getInfoSucc()
window.addEventListener("resize", this.resizeTheChart)
},
beforeDestroy () {
window.removeEventListener("resize", this.resizeTheChart);
},
更多推荐
已为社区贡献4条内容
所有评论(0)