最近遇到的坑width:100%加载出来echarts。echarts提示是没有获取dom的width或者高度。也找了很多网上的办法用nextTick也不行。
<el-carousel :autoplay="true" style="height: 4.4rem" arrow="never" >
<el-carousel-item v-for="(item,index) in 4" :key="item" style="height: 4.4rem">
<div v-show="index!==3" :key="item" style="height: 4.4rem;width: 100%" :class="`chart${index+1}`"></div>
<div style="height: 4.2rem;width: 476px" v-show="index===3">
<dv-scroll-board :config="confi" />
</div>
</el-carousel-item>
</el-carousel>
后面加了一个定时器加载就正常了