- 表格資料為空時插入顯示文本(預設“暫無資料”)
-
1 <el-table 2 :data="tableData" 3 border 4 empty-text="目前資料沒有,請添加資料" 5 style="width: 100%"> 6 <el-table-column 7 align="center" 8 prop="date" 9 label="日期" 10 width="180"> 11 </el-table-column> 12 <el-table-column 13 align="center" 14 prop="name" 15 label="姓名" 16 width="180"> 17 </el-table-column> 18 <el-table-column 19 align="center" 20 prop="address" 21 label="位址"> 22 </el-table-column> 23 </el-table>
-
- 表格資料為空時插入HTML
1 <el-table
2 :data="tableData"
3 border
4 empty-text="目前資料沒有,請添加資料"
5 style="width: 100%">
6 <el-table-column
7 align="center"
8 prop="date"
9 label="日期"
10 width="180">
11 </el-table-column>
12 <el-table-column
13 align="center"
14 prop="name"
15 label="姓名"
16 width="180">
17 </el-table-column>
18 <el-table-column
19 align="center"
20 prop="address"
21 label="位址">
22 </el-table-column>
23 <div slot="empty">
24 <p>
25 <el-button size="small" type="primary"> 添加 </el-button>
26 </p>
27 </div>
28 </el-table>
轉載于:https://www.cnblogs.com/zhaoxiaoying/p/10136136.html