上一篇分享,我们留了一个结尾,就是resize方法不生效导致我们的Echarts,不能随着我们的屏幕自适应,解决方法如下:
<style lang="scss" scoped>
::v-deep.echarts {
width: 100%;
height: 100%;
div {
&:nth-child(1) {
width: 100% !important;
height: 100% !important;
canvas {
width: 100% !important;
height: 100% !important;
}
}
}
}
</style>
在我项目中用这个解决了当时项目的自适应问题,性价比挺高的,有更好方法的大佬可以私我,储存储存哈哈哈