@
<template>
<div>
<!-- 方法二 -->
<!-- <el-table
:data="tableData"
style="width: 100%">
<el-table-column
v-for="(item,index) in tableDatahe"
:key="index"
:prop="item.props"
:label="item.name"
:render-header="renderHeader"
width="180">
<template slot="header">
<el-button type="primary">
{
{item.name}}
</el-button>
</template>
</el-table-column>
</el-table> -->
<el-table
:data="tableData"
style="width: 100%">
<el-table-column
v-for="(item,index) in tableDatahe"
:key="index"
:prop="propDatahe[index].props"
width="180">
<template #header>
<el-button type="primary">
{
{tableDatahe[index]}}
</el-button>
</template>
</</
动态渲染vue表格的表头和表体
最新推荐文章于 2024-02-25 15:51:33 发布
本文介绍了如何在Vue.js应用中实现动态渲染表格的表头和表体,通过使用v-for指令结合数据驱动的方式,动态生成表格结构,适用于各种动态数据场景。
摘要由CSDN通过智能技术生成