记录项目中使用 echarts resize 不生效问题

2022-05-30  本文已影响0人  无题syl

使图表宽高与改变宽高之后的容器相适应 注意 ::v-deep 挺重要 .box是存放echarts图表容器(div)


<style lang="scss" scoped>
::v-deep.box {
  width: 100%;
  height: 100%;
  div {
    &:nth-child(1) {
      width: 100% !important;
      height: 100% !important;
      canvas {
        width: 100% !important;
        height: 100% !important;
      }
    }
  }
}

上一篇 下一篇

猜你喜欢

热点阅读