When the Element Plus el-table data is empty, customize the content [the default is No Data]

1. Set by Table property

<div class="el-plus-table">
  <el-table empty-text="暂无数据" :data="tableData" style="width: 100%">
    <el-table-column prop="date" label="Date" width="180" />
    <el-table-column prop="name" label="Name" width="180" />
    <el-table-column prop="address" label="Address" />
  </el-table>
</div>

2. Set by Table slot

<div class="el-plus-table">
  <el-table :data="tableData" style="width: 100%">
    <template #empty>暂无数据</template>
    <el-table-column prop="date" label="Date" width="180" />
    <el-table-column prop="name" label="Name" width="180" />
    <el-table-column prop="address" label="Address" />
  </el-table>
</div>

3. Rendering

insert image description here

Guess you like

Origin blog.csdn.net/weixin_43756494/article/details/132364812