# Table 表格
基于 El-Table (opens new window) 常用功能总结
# 基础用法
提示
# 添加序号
<el-table-column label="#" type="index" align="center" width="50">
<template slot-scope="scope">
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
# 去除hover颜色
::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: transparent;
}
# 点击行勾选
<el-table
@row-click="rowClick"
row-key="templateId"
ref="table"
</el-table>
rowClick(row, event, column) {
this.$refs.table.toggleRowSelection(row)
}
# 横向滚动条加粗
::v-deep .el-table__body-wrapper, .el-scrollbar__wrap {
&::-webkit-scrollbar {
height: 8px !important;
}
}
注意: 示例布局有误,复制到若依项目中正常。
Copy