(component): update

This commit is contained in:
就眠儀式 2022-10-22 00:01:13 +08:00
parent d852b6ee6f
commit dec22cebe9
3 changed files with 12 additions and 6 deletions

View File

@ -15,8 +15,11 @@
table-layout: fixed;
}
.layui-table .layui-empty {
margin: 20px;
.layui-table-body .layui-empty {
left: 0px;
position: sticky;
margin: 0px;
padding: 20px;
}
.layui-table th {

View File

@ -421,6 +421,8 @@ const sortTable = (e: any, key: string, sort: string) => {
let tableBody = ref<HTMLElement | null>(null);
let tableHeader = ref<HTMLElement | null>(null);
let tableHeaderTable = ref<HTMLElement | null>(null);
const tableBodyEmptyWidth = ref();
let scrollWidthCell = ref(0);
const getScrollWidth = () => {
@ -431,6 +433,7 @@ const getScrollWidth = () => {
} else {
scrollWidthCell.value = 0;
}
tableBodyEmptyWidth.value = tableHeaderTable.value?.offsetWidth + "px";
};
const hasl = ref(false);
@ -682,7 +685,7 @@ onBeforeUnmount(() => {
:style="[{ 'padding-right': `${scrollWidthCell}px` }]"
>
<div class="layui-table-header-wrapper" ref="tableHeader">
<table class="layui-table" :lay-size="size" :lay-skin="skin">
<table class="layui-table" :lay-size="size" :lay-skin="skin" ref="tableHeaderTable">
<colgroup>
<template v-for="column in tableBodyColumns" :key="column">
<template v-if="tableColumnKeys.includes(column.key)">
@ -875,9 +878,8 @@ onBeforeUnmount(() => {
</tr>
</tbody>
</table>
<lay-empty
v-if="tableDataSource.length == 0 && loading == false"
></lay-empty>
<lay-empty v-if="tableDataSource.length == 0 && loading == false"></lay-empty>
<div :style="{'width': tableBodyEmptyWidth }"></div>
<template v-if="loading == true">
<div class="layui-table-loading">
<i

View File

@ -31,6 +31,7 @@
<li>[新增] date-picker 组件 contentStyle 属性, 用于自定义内容区域 style 属性。</li>
<li>[修复] date-picker 组件 type 属性为 date 值, range 属性为 true 时, 结束月份出现 13 月的问题。</li>
<li>[修复] space 组件 size 属性使用内置 string ['md','sm'] 不生效的问题。</li>
<li>[修复] table 组件 datasource 为空, 表头超出宽度无法滚动的问题。</li>
</ul>
</li>
</ul>