test: update snap

pull/4639/head
tangjinzhou 2021-09-09 23:33:02 +08:00
parent 16e801249c
commit d3acab2d55
9 changed files with 4807 additions and 5064 deletions

View File

@ -1,4 +1,4 @@
import RcTable, { Summary } from '../vc-table'; import RcTable from '../vc-table';
import type { TableProps as RcTableProps } from '../vc-table/Table'; import type { TableProps as RcTableProps } from '../vc-table/Table';
import { INTERNAL_HOOKS } from '../vc-table/Table'; import { INTERNAL_HOOKS } from '../vc-table/Table';
import type { SpinProps } from '../spin'; import type { SpinProps } from '../spin';
@ -23,11 +23,7 @@ import type {
TableAction, TableAction,
FilterValue, FilterValue,
} from './interface'; } from './interface';
import useSelection, { import useSelection from './hooks/useSelection';
SELECTION_ALL,
SELECTION_INVERT,
SELECTION_NONE,
} from './hooks/useSelection';
import type { SortState } from './hooks/useSorter'; import type { SortState } from './hooks/useSorter';
import useSorter, { getSortData } from './hooks/useSorter'; import useSorter, { getSortData } from './hooks/useSorter';
import type { FilterState } from './hooks/useFilter'; import type { FilterState } from './hooks/useFilter';
@ -36,8 +32,6 @@ import useTitleColumns from './hooks/useTitleColumns';
import renderExpandIcon from './ExpandIcon'; import renderExpandIcon from './ExpandIcon';
import scrollTo from '../_util/scrollTo'; import scrollTo from '../_util/scrollTo';
import defaultLocale from '../locale/en_US'; import defaultLocale from '../locale/en_US';
import Column from './Column';
import ColumnGroup from './ColumnGroup';
import type { SizeType } from '../config-provider'; import type { SizeType } from '../config-provider';
import devWarning from '../vc-util/devWarning'; import devWarning from '../vc-util/devWarning';
import type { PropType } from 'vue'; import type { PropType } from 'vue';
@ -240,7 +234,7 @@ const InteralTable = defineComponent<
'customFilterIcon', 'customFilterIcon',
'customFilterDropdown', 'customFilterDropdown',
], ],
setup(props, { attrs, slots, emit }) { setup(props, { attrs, slots }) {
devWarning( devWarning(
!(typeof props.rowKey === 'function' && props.rowKey.length > 1), !(typeof props.rowKey === 'function' && props.rowKey.length > 1),
'Table', 'Table',

View File

@ -5,44 +5,41 @@ exports[`Table.pagination renders pagination correctly 1`] = `
<div class="ant-spin-nested-loading"> <div class="ant-spin-nested-loading">
<!----> <!---->
<div class="ant-spin-container"> <div class="ant-spin-container">
<div class="ant-table ant-table-default ant-table-scroll-position-left"> <div class="ant-table">
<!----> <!---->
<div class="ant-table-container">
<div class="ant-table-content"> <div class="ant-table-content">
<!----> <table style="table-layout: auto;">
<div class="ant-table-body"> <colgroup></colgroup>
<table class="">
<colgroup>
<col data-key="name">
</colgroup>
<thead class="ant-table-thead"> <thead class="ant-table-thead">
<tr> <tr>
<th colstart="0" colspan="1" colend="0" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Name</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="0" colend="0">
</div></span> <!---->Name
<!---->
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody class="ant-table-tbody"> <tbody class="ant-table-tbody">
<tr class="ant-table-row ant-table-row-level-0" data-row-key="0">
<td class="">
<!----> <!---->
<tr data-row-key="0" class="ant-table-row ant-table-row-level-0">
<td class="ant-table-cell ant-table-cell-with-append">
<!---->Jack <!---->Jack
</td> </td>
</tr> </tr>
<tr class="ant-table-row ant-table-row-level-0" data-row-key="1">
<td class="">
<!----> <!---->
<tr data-row-key="1" class="ant-table-row ant-table-row-level-0">
<td class="ant-table-cell ant-table-cell-with-append">
<!---->Lucy <!---->Lucy
</td> </td>
</tr> </tr>
<!---->
</tbody> </tbody>
<!---->
</table> </table>
</div> </div>
<!----> </div>
<!----> <!---->
</div> </div>
</div> <ul unselectable="on" class="ant-pagination my-page">
<ul unselectable="on" class="ant-pagination my-page ant-table-pagination">
<!----> <!---->
<li title="Previous Page" class="ant-pagination-prev ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="left" class="anticon anticon-left"><svg focusable="false" class="" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></span></button></li> <li title="Previous Page" class="ant-pagination-prev ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="left" class="anticon anticon-left"><svg focusable="false" class="" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></span></button></li>
<li title="1" tabindex="0" class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"><a rel="nofollow">1</a></li> <li title="1" tabindex="0" class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"><a rel="nofollow">1</a></li>

View File

@ -5,86 +5,83 @@ exports[`Table.rowSelection fix selection column on the left 1`] = `
<div class="ant-spin-nested-loading"> <div class="ant-spin-nested-loading">
<!----> <!---->
<div class="ant-spin-container"> <div class="ant-spin-container">
<div class="ant-table ant-table-default ant-table-scroll-position-left ant-table-scroll-position-right"> <div class="ant-table ant-table-has-fix-left">
<!----> <!---->
<div class="ant-table-container">
<div class="ant-table-content"> <div class="ant-table-content">
<div class="ant-table-scroll"> <table style="table-layout: auto;">
<!---->
<div class="ant-table-body">
<table class="">
<colgroup> <colgroup>
<col data-key="selection-column" class="ant-table-selection-col"> <col class="ant-table-selection-col">
<col data-key="name">
</colgroup> </colgroup>
<thead class="ant-table-thead"> <thead class="ant-table-thead">
<tr> <tr>
<th colstart="0" colspan="1" colend="0" rowspan="1" class="ant-table-selection-column"><span class="ant-table-header-column"><div><span class="ant-table-column-title"><div class="ant-table-selection"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span> <th class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last ant-table-selection-column" style="position: sticky; left: 0px;" colstart="0" colend="0">
<!----></label>
<!----> <!---->
</div></span><span class="ant-table-column-sorter"><!----></span> <div class="ant-table-selection"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
</div></span>
<!----> <!---->
</label>
<!---->
</div>
</th> </th>
<th colstart="1" colspan="1" colend="1" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Name</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="1" colend="1">
</div></span> <!---->Name
<!---->
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody class="ant-table-tbody"> <tbody class="ant-table-tbody">
<tr class="ant-table-row ant-table-row-level-0" data-row-key="0">
<td class="ant-table-selection-column">
<!----> <!---->
<!----><span><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span> <tr data-row-key="0" class="ant-table-row ant-table-row-level-0">
<!----></label></span> <td class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last ant-table-cell-with-append ant-table-selection-column" style="position: sticky; left: 0px;">
<!----><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
<!---->
</label>
</td> </td>
<td class=""> <td class="ant-table-cell ant-table-cell-with-append">
<!---->
<!---->Jack <!---->Jack
</td> </td>
</tr> </tr>
<tr class="ant-table-row ant-table-row-level-0" data-row-key="1">
<td class="ant-table-selection-column">
<!----> <!---->
<!----><span><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span> <tr data-row-key="1" class="ant-table-row ant-table-row-level-0">
<!----></label></span> <td class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last ant-table-cell-with-append ant-table-selection-column" style="position: sticky; left: 0px;">
<!----><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
<!---->
</label>
</td> </td>
<td class=""> <td class="ant-table-cell ant-table-cell-with-append">
<!---->
<!---->Lucy <!---->Lucy
</td> </td>
</tr> </tr>
<tr class="ant-table-row ant-table-row-level-0" data-row-key="2">
<td class="ant-table-selection-column">
<!----> <!---->
<!----><span><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span> <tr data-row-key="2" class="ant-table-row ant-table-row-level-0">
<!----></label></span> <td class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last ant-table-cell-with-append ant-table-selection-column" style="position: sticky; left: 0px;">
<!----><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
<!---->
</label>
</td> </td>
<td class=""> <td class="ant-table-cell ant-table-cell-with-append">
<!---->
<!---->Tom <!---->Tom
</td> </td>
</tr> </tr>
<tr class="ant-table-row ant-table-row-level-0" data-row-key="3">
<td class="ant-table-selection-column">
<!----> <!---->
<!----><span><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span> <tr data-row-key="3" class="ant-table-row ant-table-row-level-0">
<!----></label></span> <td class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last ant-table-cell-with-append ant-table-selection-column" style="position: sticky; left: 0px;">
<!----><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
<!---->
</label>
</td> </td>
<td class=""> <td class="ant-table-cell ant-table-cell-with-append">
<!---->
<!---->Jerry <!---->Jerry
</td> </td>
</tr> </tr>
<!---->
</tbody> </tbody>
<!---->
</table> </table>
</div> </div>
<!----> </div>
<!----> <!---->
</div> </div>
</div> <ul unselectable="on" class="ant-pagination ant-table-pagination ant-table-pagination-right">
</div>
<ul unselectable="on" class="ant-pagination ant-table-pagination">
<!----> <!---->
<li title="Previous Page" class="ant-pagination-prev ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="left" class="anticon anticon-left"><svg focusable="false" class="" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></span></button></li> <li title="Previous Page" class="ant-pagination-prev ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="left" class="anticon anticon-left"><svg focusable="false" class="" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></span></button></li>
<li title="1" tabindex="0" class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"><a rel="nofollow">1</a></li> <li title="1" tabindex="0" class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"><a rel="nofollow">1</a></li>

View File

@ -3,8 +3,9 @@
exports[`Table.sorter renders sorter icon correctly 1`] = ` exports[`Table.sorter renders sorter icon correctly 1`] = `
<thead class="ant-table-thead"> <thead class="ant-table-thead">
<tr> <tr>
<th colstart="0" colspan="1" colend="0" rowspan="1" class="ant-table-column-has-actions ant-table-column-has-sorters"><span class="ant-table-header-column"><div class="ant-table-column-sorters"><span class="ant-table-column-title">Name</span><span class="ant-table-column-sorter"><div title="Sort" class="ant-table-column-sorter-inner ant-table-column-sorter-inner-full"><span role="img" aria-label="caret-up" class="anticon anticon-caret-up ant-table-column-sorter-up off"><svg focusable="false" class="" data-icon="caret-up" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="0 0 1024 1024"><path d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"></path></svg></span><span role="img" aria-label="caret-down" class="anticon anticon-caret-down ant-table-column-sorter-down off"><svg focusable="false" class="" data-icon="caret-down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="0 0 1024 1024"><path d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"></path></svg></span></div></span></div></span> <th class="ant-table-cell ant-table-column-has-sorters" colstart="0" colend="0">
<!----> <!---->
<div class="ant-table-column-sorters"><span class="ant-table-column-title">Name</span><span class="ant-table-column-sorter ant-table-column-sorter-full"><span class="ant-table-column-sorter-inner"><span role="img" aria-label="caret-up" class="anticon anticon-caret-up ant-table-column-sorter-up"><svg focusable="false" class="" data-icon="caret-up" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="0 0 1024 1024"><path d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"></path></svg></span><span role="img" aria-label="caret-down" class="anticon anticon-caret-down ant-table-column-sorter-down"><svg focusable="false" class="" data-icon="caret-down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="0 0 1024 1024"><path d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"></path></svg></span></span></span></div>
</th> </th>
</tr> </tr>
</thead> </thead>

View File

@ -5,59 +5,52 @@ exports[`Table align column should not override cell style 1`] = `
<div class="ant-spin-nested-loading"> <div class="ant-spin-nested-loading">
<!----> <!---->
<div class="ant-spin-container"> <div class="ant-spin-container">
<div class="ant-table ant-table-default ant-table-scroll-position-left"> <div class="ant-table">
<!----> <!---->
<div class="ant-table-container">
<div class="ant-table-content"> <div class="ant-table-content">
<!----> <table style="table-layout: auto;">
<div class="ant-table-body"> <colgroup></colgroup>
<table class="">
<colgroup>
<col data-key="name">
<col data-key="age">
</colgroup>
<thead class="ant-table-thead"> <thead class="ant-table-thead">
<tr> <tr>
<th colstart="0" colspan="1" colend="0" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Name</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="0" colend="0">
</div></span> <!---->Name
<!---->
</th> </th>
<th colstart="1" colspan="1" colend="1" rowspan="1" style="text-align: center;" class="ant-table-align-center"><span class="ant-table-header-column"><div><span class="ant-table-column-title">Age</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" style="text-align: center;" colstart="1" colend="1">
</div></span> <!---->Age
<!---->
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody class="ant-table-tbody"> <tbody class="ant-table-tbody">
<tr class="ant-table-row ant-table-row-level-0" data-row-key="1">
<td class="">
<!----> <!---->
<tr data-row-key="1" class="ant-table-row ant-table-row-level-0">
<td class="ant-table-cell ant-table-cell-with-append">
<!----> <!---->
<!----> <!---->
</td> </td>
<td class="" style="text-align: center; color: red;"> <td style="color: red; text-align: center;" class="ant-table-cell ant-table-cell-with-append">
<!---->
<!---->32 <!---->32
</td> </td>
</tr> </tr>
<tr class="ant-table-row ant-table-row-level-0" data-row-key="2">
<td class="">
<!----> <!---->
<tr data-row-key="2" class="ant-table-row ant-table-row-level-0">
<td class="ant-table-cell ant-table-cell-with-append">
<!----> <!---->
<!----> <!---->
</td> </td>
<td class="" style="text-align: center; color: red;"> <td style="color: red; text-align: center;" class="ant-table-cell ant-table-cell-with-append">
<!---->
<!---->42 <!---->42
</td> </td>
</tr> </tr>
<!---->
</tbody> </tbody>
<!---->
</table> </table>
</div> </div>
<!----> </div>
<!----> <!---->
</div> </div>
</div> <ul unselectable="on" class="ant-pagination ant-table-pagination ant-table-pagination-right">
<ul unselectable="on" class="ant-pagination ant-table-pagination">
<!----> <!---->
<li title="Previous Page" class="ant-pagination-prev ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="left" class="anticon anticon-left"><svg focusable="false" class="" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></span></button></li> <li title="Previous Page" class="ant-pagination-prev ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="left" class="anticon anticon-left"><svg focusable="false" class="" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></span></button></li>
<li title="1" tabindex="0" class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"><a rel="nofollow">1</a></li> <li title="1" tabindex="0" class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"><a rel="nofollow">1</a></li>
@ -74,74 +67,62 @@ exports[`Table renders JSX correctly 1`] = `
<div class="ant-spin-nested-loading"> <div class="ant-spin-nested-loading">
<!----> <!---->
<div class="ant-spin-container"> <div class="ant-spin-container">
<div class="ant-table ant-table-default ant-table-scroll-position-left"> <div class="ant-table">
<!----> <!---->
<div class="ant-table-container">
<div class="ant-table-content"> <div class="ant-table-content">
<!----> <table style="table-layout: auto;">
<div class="ant-table-body"> <colgroup></colgroup>
<table class="">
<colgroup>
<col data-key="firstName">
<col data-key="lastName">
<col data-key="age">
</colgroup>
<thead class="ant-table-thead"> <thead class="ant-table-thead">
<tr> <tr>
<th colstart="0" hassubcolumns="true" colspan="2" colend="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Name</span><span class="ant-table-column-sorter"><!----></span> <th colspan="2" class="ant-table-cell" colstart="0" hassubcolumns="true" colend="1">
</div></span> <!---->Name
<!---->
</th> </th>
<th colstart="2" rowspan="2" colspan="1" colend="2" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Age</span><span class="ant-table-column-sorter"><!----></span> <th rowspan="2" class="ant-table-cell" colstart="2" colend="2">
</div></span> <!---->Age
<!---->
</th> </th>
</tr> </tr>
<tr> <tr>
<th colstart="0" colspan="1" colend="0" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">First Name</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="0" colend="0">
</div></span> <!---->First Name
<!---->
</th> </th>
<th colstart="1" colspan="1" colend="1" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Last Name</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="1" colend="1">
</div></span> <!---->Last Name
<!---->
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody class="ant-table-tbody"> <tbody class="ant-table-tbody">
<tr class="ant-table-row ant-table-row-level-0" data-row-key="1">
<td class="">
<!----> <!---->
<tr data-row-key="1" class="ant-table-row ant-table-row-level-0">
<td class="ant-table-cell ant-table-cell-with-append">
<!---->John <!---->John
</td> </td>
<td class=""> <td class="ant-table-cell ant-table-cell-with-append">
<!---->
<!---->Brown <!---->Brown
</td> </td>
<td class=""> <td class="ant-table-cell ant-table-cell-with-append">
<!---->
<!---->32 <!---->32
</td> </td>
</tr> </tr>
<tr class="ant-table-row ant-table-row-level-0" data-row-key="2">
<td class="">
<!----> <!---->
<tr data-row-key="2" class="ant-table-row ant-table-row-level-0">
<td class="ant-table-cell ant-table-cell-with-append">
<!---->Jim <!---->Jim
</td> </td>
<td class=""> <td class="ant-table-cell ant-table-cell-with-append">
<!---->
<!---->Green <!---->Green
</td> </td>
<td class=""> <td class="ant-table-cell ant-table-cell-with-append">
<!---->
<!---->42 <!---->42
</td> </td>
</tr> </tr>
<!---->
</tbody> </tbody>
<!---->
</table> </table>
</div> </div>
<!---->
<!---->
</div> </div>
<!---->
</div> </div>
</div> </div>
</div> </div>

File diff suppressed because it is too large Load Diff

View File

@ -5,80 +5,58 @@ exports[`Table renders empty table 1`] = `
<div class="ant-spin-nested-loading"> <div class="ant-spin-nested-loading">
<!----> <!---->
<div class="ant-spin-container"> <div class="ant-spin-container">
<div class="ant-table ant-table-default ant-table-empty ant-table-scroll-position-left"> <div class="ant-table ant-table-empty">
<!----> <!---->
<div class="ant-table-container">
<div class="ant-table-content"> <div class="ant-table-content">
<!----> <table style="table-layout: auto;">
<div class="ant-table-body"> <colgroup></colgroup>
<table class="">
<colgroup>
<col data-key="1">
<col data-key="2">
<col data-key="3">
<col data-key="4">
<col data-key="5">
<col data-key="6">
<col data-key="7">
<col data-key="8">
</colgroup>
<thead class="ant-table-thead"> <thead class="ant-table-thead">
<tr> <tr>
<th colstart="0" colspan="1" colend="0" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 1</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="0" colend="0">
</div></span> <!---->Column 1
<!---->
</th> </th>
<th colstart="1" colspan="1" colend="1" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 2</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="1" colend="1">
</div></span> <!---->Column 2
<!---->
</th> </th>
<th colstart="2" colspan="1" colend="2" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 3</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="2" colend="2">
</div></span> <!---->Column 3
<!---->
</th> </th>
<th colstart="3" colspan="1" colend="3" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 4</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="3" colend="3">
</div></span> <!---->Column 4
<!---->
</th> </th>
<th colstart="4" colspan="1" colend="4" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 5</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="4" colend="4">
</div></span> <!---->Column 5
<!---->
</th> </th>
<th colstart="5" colspan="1" colend="5" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 6</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="5" colend="5">
</div></span> <!---->Column 6
<!---->
</th> </th>
<th colstart="6" colspan="1" colend="6" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 7</span><span class="ant-table-column-sorter"><!----></span></div></span> <th class="ant-table-cell" colstart="6" colend="6">
<!----> <!---->Column 7
</th> </th>
<th colstart="7" colspan="1" colend="7" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 8</span><span class="ant-table-column-sorter"><!----></span></div></span> <th class="ant-table-cell" colstart="7" colend="7">
<!----> <!---->Column 8
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody class="ant-table-tbody"></tbody> <tbody class="ant-table-tbody">
<!---->
<tr class="ant-table-placeholder">
<td colspan="8" class="ant-table-cell">
<!---->
<!---->
</td>
</tr>
</tbody>
<!---->
</table> </table>
</div> </div>
<div class="ant-table-placeholder">
<div class="ant-empty ant-empty-normal">
<div class="ant-empty-image"><svg class="ant-empty-img-simple" width="64" height="41" viewBox="0 0 64 41">
<g transform="translate(0 1)" fill="none" fill-rule="evenodd">
<ellipse class="ant-empty-img-simple-ellipse" fill="#F5F5F5" cx="32" cy="33" rx="32" ry="7"></ellipse>
<g class="ant-empty-img-simple-g" fill-rule="nonzero" stroke="#D9D9D9">
<path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path>
<path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#FAFAFA" class="ant-empty-img-simple-path"></path>
</g>
</g>
</svg></div>
<p class="ant-empty-description">No Data</p>
<!---->
</div>
</div> </div>
<!----> <!---->
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
`; `;
exports[`Table renders empty table with custom emptyText 1`] = ` exports[`Table renders empty table with custom emptyText 1`] = `
@ -86,62 +64,54 @@ exports[`Table renders empty table with custom emptyText 1`] = `
<div class="ant-spin-nested-loading"> <div class="ant-spin-nested-loading">
<!----> <!---->
<div class="ant-spin-container"> <div class="ant-spin-container">
<div class="ant-table ant-table-default ant-table-empty ant-table-scroll-position-left"> <div class="ant-table ant-table-empty">
<!----> <!---->
<div class="ant-table-container">
<div class="ant-table-content"> <div class="ant-table-content">
<!----> <table style="table-layout: auto;">
<div class="ant-table-body"> <colgroup></colgroup>
<table class="">
<colgroup>
<col data-key="1">
<col data-key="2">
<col data-key="3">
<col data-key="4">
<col data-key="5">
<col data-key="6">
<col data-key="7">
<col data-key="8">
</colgroup>
<thead class="ant-table-thead"> <thead class="ant-table-thead">
<tr> <tr>
<th colstart="0" colspan="1" colend="0" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 1</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="0" colend="0">
</div></span> <!---->Column 1
<!---->
</th> </th>
<th colstart="1" colspan="1" colend="1" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 2</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="1" colend="1">
</div></span> <!---->Column 2
<!---->
</th> </th>
<th colstart="2" colspan="1" colend="2" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 3</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="2" colend="2">
</div></span> <!---->Column 3
<!---->
</th> </th>
<th colstart="3" colspan="1" colend="3" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 4</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="3" colend="3">
</div></span> <!---->Column 4
<!---->
</th> </th>
<th colstart="4" colspan="1" colend="4" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 5</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="4" colend="4">
</div></span> <!---->Column 5
<!---->
</th> </th>
<th colstart="5" colspan="1" colend="5" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 6</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="5" colend="5">
</div></span> <!---->Column 6
<!---->
</th> </th>
<th colstart="6" colspan="1" colend="6" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 7</span><span class="ant-table-column-sorter"><!----></span></div></span> <th class="ant-table-cell" colstart="6" colend="6">
<!----> <!---->Column 7
</th> </th>
<th colstart="7" colspan="1" colend="7" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 8</span><span class="ant-table-column-sorter"><!----></span></div></span> <th class="ant-table-cell" colstart="7" colend="7">
<!----> <!---->Column 8
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody class="ant-table-tbody"></tbody> <tbody class="ant-table-tbody">
<!---->
<tr class="ant-table-placeholder">
<td colspan="8" class="ant-table-cell">
<!---->
<!---->
</td>
</tr>
</tbody>
<!---->
</table> </table>
</div> </div>
<div class="ant-table-placeholder">custom empty text </div>
<!---->
</div> </div>
<!---->
</div> </div>
</div> </div>
</div> </div>
@ -153,178 +123,140 @@ exports[`Table renders empty table with fixed columns 1`] = `
<div class="ant-spin-nested-loading"> <div class="ant-spin-nested-loading">
<!----> <!---->
<div class="ant-spin-container"> <div class="ant-spin-container">
<div class="ant-table ant-table-default ant-table-empty ant-table-scroll-position-left ant-table-scroll-position-right"> <div class="ant-table ant-table-has-fix-left ant-table-has-fix-right ant-table-empty">
<!----> <!---->
<div class="ant-table-container">
<div class="ant-table-content"> <div class="ant-table-content">
<div class="ant-table-scroll"> <table style="table-layout: auto;">
<!---->
<div class="ant-table-body">
<table class="">
<colgroup> <colgroup>
<col data-key="name" style="width: 100px; min-width: 100px;"> <col style="width: 100px;">
<col data-key="age" style="width: 100px; min-width: 100px;"> <col style="width: 100px;">
<col data-key="1"> <col>
<col data-key="2"> <col>
<col data-key="3"> <col>
<col data-key="4"> <col>
<col data-key="5"> <col>
<col data-key="6"> <col>
<col data-key="7"> <col>
<col data-key="8"> <col>
<col data-key="address" style="width: 100px; min-width: 100px;"> <col style="width: 100px;">
</colgroup> </colgroup>
<thead class="ant-table-thead"> <thead class="ant-table-thead">
<tr> <tr>
<th colstart="0" colspan="1" colend="0" rowspan="1" class="ant-table-row-cell-break-word"><span class="ant-table-header-column"><div><span class="ant-table-column-title">Full Name</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell ant-table-cell-fix-left" style="position: sticky; left: 0px;" colstart="0" colend="0">
</div></span> <!---->Full Name
<!---->
</th> </th>
<th colstart="1" colspan="1" colend="1" rowspan="1" class="ant-table-row-cell-break-word"><span class="ant-table-header-column"><div><span class="ant-table-column-title">Age</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" style="position: sticky; left: 0px;" colstart="1" colend="1">
</div></span> <!---->Age
<!---->
</th> </th>
<th colstart="2" colspan="1" colend="2" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 1</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="2" colend="2">
</div></span> <!---->Column 1
<!---->
</th> </th>
<th colstart="3" colspan="1" colend="3" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 2</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="3" colend="3">
</div></span> <!---->Column 2
<!---->
</th> </th>
<th colstart="4" colspan="1" colend="4" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 3</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="4" colend="4">
</div></span> <!---->Column 3
<!---->
</th> </th>
<th colstart="5" colspan="1" colend="5" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 4</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="5" colend="5">
</div></span> <!---->Column 4
<!---->
</th> </th>
<th colstart="6" colspan="1" colend="6" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 5</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="6" colend="6">
</div></span> <!---->Column 5
<!---->
</th> </th>
<th colstart="7" colspan="1" colend="7" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 6</span><span class="ant-table-column-sorter"><!----></span></div></span> <th class="ant-table-cell" colstart="7" colend="7">
<!----> <!---->Column 6
</th> </th>
<th colstart="8" colspan="1" colend="8" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 7</span><span class="ant-table-column-sorter"><!----></span></div></span> <th class="ant-table-cell" colstart="8" colend="8">
<!----> <!---->Column 7
</th> </th>
<th colstart="9" colspan="1" colend="9" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 8</span><span class="ant-table-column-sorter"><!----></span></div></span> <th class="ant-table-cell" colstart="9" colend="9">
<!----> <!---->Column 8
</th> </th>
<th colstart="10" colspan="1" colend="10" rowspan="1" class="ant-table-row-cell-break-word"><span class="ant-table-header-column"><div><span class="ant-table-column-title">Action</span><span class="ant-table-column-sorter"><!----></span></div></span> <th class="ant-table-cell ant-table-cell-fix-right ant-table-cell-fix-right-first" style="position: sticky; right: 0px;" colstart="10" colend="10">
<!----> <!---->Action
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody class="ant-table-tbody"></tbody> <tbody class="ant-table-tbody">
<!---->
<tr class="ant-table-placeholder">
<td colspan="11" class="ant-table-cell">
<!---->
<!---->
</td>
</tr>
</tbody>
<!---->
</table> </table>
</div> </div>
<div class="ant-table-placeholder">
<div class="ant-empty ant-empty-normal">
<div class="ant-empty-image"><svg class="ant-empty-img-simple" width="64" height="41" viewBox="0 0 64 41">
<g transform="translate(0 1)" fill="none" fill-rule="evenodd">
<ellipse class="ant-empty-img-simple-ellipse" fill="#F5F5F5" cx="32" cy="33" rx="32" ry="7"></ellipse>
<g class="ant-empty-img-simple-g" fill-rule="nonzero" stroke="#D9D9D9">
<path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path>
<path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#FAFAFA" class="ant-empty-img-simple-path"></path>
</g>
</g>
</svg></div>
<p class="ant-empty-description">No Data</p>
<!---->
</div>
</div> </div>
<!----> <!---->
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
`; `;
exports[`Table renders empty table without emptyText when loading 1`] = ` exports[`Table renders empty table without emptyText when loading 1`] = `
<div class="ant-table-wrapper"> <div class="ant-table-wrapper">
<div class="ant-spin-nested-loading"> <div class="ant-spin-nested-loading">
<div> <div>
<div class="ant-spin ant-spin-spinning ant-table-without-pagination ant-table-spin-holder"><span class="ant-spin-dot ant-spin-dot-spin"><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i></span> <div class="ant-spin ant-spin-spinning"><span class="ant-spin-dot ant-spin-dot-spin"><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i></span>
<!----> <!---->
</div> </div>
</div> </div>
<div class="ant-spin-container ant-spin-blur"> <div class="ant-spin-container ant-spin-blur">
<div class="ant-table ant-table-default ant-table-empty ant-table-scroll-position-left"> <div class="ant-table ant-table-empty">
<!----> <!---->
<div class="ant-table-container">
<div class="ant-table-content"> <div class="ant-table-content">
<!----> <table style="table-layout: auto;">
<div class="ant-table-body"> <colgroup></colgroup>
<table class="">
<colgroup>
<col data-key="1">
<col data-key="2">
<col data-key="3">
<col data-key="4">
<col data-key="5">
<col data-key="6">
<col data-key="7">
<col data-key="8">
</colgroup>
<thead class="ant-table-thead"> <thead class="ant-table-thead">
<tr> <tr>
<th colstart="0" colspan="1" colend="0" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 1</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="0" colend="0">
</div></span> <!---->Column 1
<!---->
</th> </th>
<th colstart="1" colspan="1" colend="1" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 2</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="1" colend="1">
</div></span> <!---->Column 2
<!---->
</th> </th>
<th colstart="2" colspan="1" colend="2" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 3</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="2" colend="2">
</div></span> <!---->Column 3
<!---->
</th> </th>
<th colstart="3" colspan="1" colend="3" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 4</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="3" colend="3">
</div></span> <!---->Column 4
<!---->
</th> </th>
<th colstart="4" colspan="1" colend="4" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 5</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="4" colend="4">
</div></span> <!---->Column 5
<!---->
</th> </th>
<th colstart="5" colspan="1" colend="5" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 6</span><span class="ant-table-column-sorter"><!----></span> <th class="ant-table-cell" colstart="5" colend="5">
</div></span> <!---->Column 6
<!---->
</th> </th>
<th colstart="6" colspan="1" colend="6" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 7</span><span class="ant-table-column-sorter"><!----></span></div></span> <th class="ant-table-cell" colstart="6" colend="6">
<!----> <!---->Column 7
</th> </th>
<th colstart="7" colspan="1" colend="7" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Column 8</span><span class="ant-table-column-sorter"><!----></span></div></span> <th class="ant-table-cell" colstart="7" colend="7">
<!----> <!---->Column 8
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody class="ant-table-tbody"></tbody> <tbody class="ant-table-tbody">
<!---->
<tr class="ant-table-placeholder">
<td colspan="8" class="ant-table-cell">
<!---->
<!---->
</td>
</tr>
</tbody>
<!---->
</table> </table>
</div> </div>
<div class="ant-table-placeholder">
<div class="ant-empty ant-empty-normal">
<div class="ant-empty-image"><svg class="ant-empty-img-simple" width="64" height="41" viewBox="0 0 64 41">
<g transform="translate(0 1)" fill="none" fill-rule="evenodd">
<ellipse class="ant-empty-img-simple-ellipse" fill="#F5F5F5" cx="32" cy="33" rx="32" ry="7"></ellipse>
<g class="ant-empty-img-simple-g" fill-rule="nonzero" stroke="#D9D9D9">
<path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path>
<path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#FAFAFA" class="ant-empty-img-simple-path"></path>
</g>
</g>
</svg></div>
<p class="ant-empty-description">No Data</p>
<!---->
</div>
</div> </div>
<!----> <!---->
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
`; `;

View File

@ -14,7 +14,7 @@ import {
} from 'vue'; } from 'vue';
import { useInjectTable } from '../context/TableContext'; import { useInjectTable } from '../context/TableContext';
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import addEventListenerWrap from 'ant-design-vue/es/vc-util/Dom/addEventListener'; import addEventListenerWrap from '../../vc-util/Dom/addEventListener';
function useColumnWidth(colWidthsRef: Ref<readonly number[]>, columCountRef: Ref<number>) { function useColumnWidth(colWidthsRef: Ref<readonly number[]>, columCountRef: Ref<number>) {
return computed(() => { return computed(() => {
@ -71,13 +71,13 @@ export default defineComponent<FixedHeaderProps<DefaultRecordType>>({
tableContext.isSticky && !props.fixHeader ? 0 : tableContext.scrollbarSize, tableContext.isSticky && !props.fixHeader ? 0 : tableContext.scrollbarSize,
); );
const scrollRef = ref(); const scrollRef = ref();
function onWheel(e: WheelEvent) { const onWheel = (e: WheelEvent) => {
const { currentTarget, deltaX } = e; const { currentTarget, deltaX } = e;
if (deltaX) { if (deltaX) {
emit('scroll', { currentTarget, scrollLeft: (currentTarget as any).scrollLeft + deltaX }); emit('scroll', { currentTarget, scrollLeft: (currentTarget as any).scrollLeft + deltaX });
e.preventDefault(); e.preventDefault();
} }
} };
const wheelEvent = ref(); const wheelEvent = ref();
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {

View File

@ -1,5 +1,5 @@
// debugger tsx // debugger tsx
import Demo from '../../components/table/demo/summary.vue'; import Demo from '../../components/table/demo/index.vue';
export default { export default {
render() { render() {