思路就是通过echarts官方的方法resize方法。不过vue3你需要一个时机去调用这个方法
<template>
<el-row :gutter="10">
<el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
<el-card class="box-card">
<template #header>
<div class="card-header">
<span>Card name</span>
<el-button class="button" type="text">Operation button</el-button>
</div>
</template>
<div style="height: 200px" ref="homeLaboratoryRef"></div>
</el-card>
</el-col>
<el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
<el-card class="box-card">
<template #header>
<div class="card-header">
<span>Card name</span>
<el-button class="button" type="text">Operation button</el-button>
</div>
</template>
<div v-for="o in 4" :key="o" class="text item">
{
{
"List item " + o }}
</div>