🐛(component): 修复 table 工具栏 dropdown 随滚动条滚动

This commit is contained in:
就眠儀式 2022-08-09 01:16:24 +08:00
parent 212ce9a599
commit e05781963d

View File

@ -186,8 +186,8 @@ function diff(arr1: any[], arr2: any[]) {
var newArr = []; var newArr = [];
arr1 = Array.from(new Set(arr1)); // arr1 = Array.from(new Set(arr1)); //
arr2 = Array.from(new Set(arr2)); // arr2 = Array.from(new Set(arr2)); //
newArr =arr1.concat(arr2); newArr = arr1.concat(arr2);
return newArr.filter(x=>!(arr1.includes(x) && arr2.includes(x))) return newArr.filter((x) => !(arr1.includes(x) && arr2.includes(x)));
} }
/** /**
@ -560,7 +560,7 @@ const renderTotalRowCell = (column: any) => {
<slot name="toolbar"></slot> <slot name="toolbar"></slot>
</div> </div>
<div v-if="defaultToolbar" class="layui-table-tool-self"> <div v-if="defaultToolbar" class="layui-table-tool-self">
<lay-dropdown> <lay-dropdown updateAtScroll>
<div class="layui-inline" title="筛选列" lay-event="LAYTABLE_PRINT"> <div class="layui-inline" title="筛选列" lay-event="LAYTABLE_PRINT">
<i class="layui-icon layui-icon-cols"></i> <i class="layui-icon layui-icon-cols"></i>
</div> </div>
@ -618,7 +618,12 @@ const renderTotalRowCell = (column: any) => {
</template> </template>
</colgroup> </colgroup>
<thead> <thead>
<template v-for="(tableHeadColumn, tableHeadColumnIndex) in tableHeadColumns" :key="tableHeadColumnIndex"> <template
v-for="(
tableHeadColumn, tableHeadColumnIndex
) in tableHeadColumns"
:key="tableHeadColumnIndex"
>
<tr> <tr>
<template <template
v-for="(column, columnIndex) in tableHeadColumn" v-for="(column, columnIndex) in tableHeadColumn"