style: 优化 table 示例样式

This commit is contained in:
pany 2022-10-28 14:27:35 +08:00
parent da63f9e204
commit fa55b36d3e
6 changed files with 15 additions and 7 deletions

View File

@ -5,7 +5,7 @@ import { Setting } from "@element-plus/icons-vue"
const props = defineProps({ const props = defineProps({
buttonTop: { buttonTop: {
type: Number, type: Number,
default: 250 default: 350
} }
}) })

View File

@ -22,7 +22,7 @@ VXETable.setup({
showHeaderOverflow: "tooltip", showHeaderOverflow: "tooltip",
autoResize: true, autoResize: true,
// stripe: false, // stripe: false,
border: false, border: "inner",
// round: false, // round: false,
emptyText: "暂无数据", emptyText: "暂无数据",
rowConfig: { rowConfig: {
@ -30,7 +30,7 @@ VXETable.setup({
isCurrent: true isCurrent: true
}, },
columnConfig: { columnConfig: {
resizable: true resizable: false
}, },
align: "center", align: "center",
headerAlign: "center", headerAlign: "center",

View File

@ -0,0 +1,8 @@
/** 自定义 Element Plus 样式 */
.el-table {
// 表头
th.el-table__cell {
background-color: var(--el-fill-color-light) !important;
}
}

View File

@ -2,6 +2,8 @@
@import "./variables.css"; @import "./variables.css";
// Transition // Transition
@import "./transition.scss"; @import "./transition.scss";
// Element Plus
@import "./element-plus.scss";
// Vxe Table // Vxe Table
@import "./vxe-table.scss"; @import "./vxe-table.scss";
// 注册多主题 // 注册多主题

View File

@ -20,6 +20,7 @@
&--pager-wrapper { &--pager-wrapper {
.vxe-pager { .vxe-pager {
height: 70px !important; height: 70px !important;
padding: 0 20px !important;
&--wrapper { &--wrapper {
@media screen and (max-width: 750px) { @media screen and (max-width: 750px) {
.vxe-pager--total, .vxe-pager--total,

View File

@ -158,7 +158,7 @@ watch([() => paginationData.currentPage, () => paginationData.pageSize], getTabl
</div> </div>
</div> </div>
<div class="table-wrapper"> <div class="table-wrapper">
<el-table :data="tableData" header-cell-class-name="table-header"> <el-table :data="tableData">
<el-table-column type="selection" width="50" align="center" /> <el-table-column type="selection" width="50" align="center" />
<el-table-column prop="username" label="用户名" align="center" /> <el-table-column prop="username" label="用户名" align="center" />
<el-table-column prop="roles" label="角色" align="center"> <el-table-column prop="roles" label="角色" align="center">
@ -236,9 +236,6 @@ watch([() => paginationData.currentPage, () => paginationData.pageSize], getTabl
.table-wrapper { .table-wrapper {
margin-bottom: 20px; margin-bottom: 20px;
:deep(.table-header) {
background-color: var(--el-fill-color-light) !important;
}
} }
.pager-wrapper { .pager-wrapper {