el-carousel中循环table列表
在el-carousel中循环table列表,可以将每个table作为一个item,然后通过v-for循环渲染。
例如:
<el-carousel :interval="4000" arrow="always">
<el-carousel-item v-for="(item, index) in tableList" :key="index">
<el-table :data="item.data">
<el-table-column prop="name" label="Name"></el-table-column>
<el-table-column prop="age" label="Age"></el-table-column>
<el-table-column prop="address" label="Address"></el-table-column>
</el-table>
</el-carousel-item>
</el-carousel>
其中,tableList是一个数组,每个元素都是一个对象,包含该table的数据。可以使用v-for循环渲染每个table。
注意,需要在el-carousel-item上设置:key属性,以便Vue能够正确地追踪每个元素
原文地址: https://www.cveoy.top/t/topic/htxo 著作权归作者所有。请勿转载和采集!