@@ -167,6 +167,10 @@ export default {
167167 colsWidthsEfficientCount : 0 ,
168168 // has init columns widths 此属性可优化固定列表格初始化渲染慢问题
169169 hasPreparedColsWidths : false ,
170+ // virtual scroll preview rendered rowKey
171+ virtualScrollPreviewRenderedRowKeys : [ ] ,
172+ // virtual scroll repeat rendered rowKey
173+ virtualScrollRepeatRenderedRowKeys : [ ] ,
170174 } ,
171175 computed : {
172176 /*
@@ -810,6 +814,21 @@ export default {
810814 }
811815 return result ;
812816 } ,
817+
818+ // rendering row keys
819+ renderingRowKeys ( rowKeys ) {
820+ const {
821+ virtualScrollPreviewRenderedRowKeys : previewRenderedRowKeys ,
822+ } = this . $options . customOption ;
823+
824+ this . $options . customOption . virtualScrollRepeatRenderedRowKeys =
825+ rowKeys . filter ( ( rowKey ) => {
826+ return previewRenderedRowKeys . indexOf ( rowKey ) != - 1 ;
827+ } ) ;
828+
829+ this . $options . customOption . virtualScrollPreviewRenderedRowKeys =
830+ rowKeys ;
831+ } ,
813832 } ,
814833 mounted ( ) {
815834 // receive checkbox row selected change from VE_TABLE_BODY_CHECKBOX_CONTENT
@@ -866,6 +885,9 @@ export default {
866885 isScrolling,
867886 } = this ;
868887
888+ const { virtualScrollRepeatRenderedRowKeys } =
889+ this . $options . customOption ;
890+
869891 return (
870892 < tbody >
871893 { /* Measure each column width with additional hidden col */ }
@@ -893,6 +915,37 @@ export default {
893915 } ) }
894916 </ tr >
895917 { actualRenderTableData . map ( ( rowData , rowIndex ) => {
918+ const trProps = {
919+ key : this . getTrKey ( { rowData, rowIndex } ) ,
920+ props : {
921+ rowIndex,
922+ rowData,
923+ colgroups,
924+ expandOption,
925+ expandedRowkeys,
926+ checkboxOption,
927+ radioOption,
928+ rowKeyFieldName,
929+ expandRowChange,
930+ internalCheckboxSelectedRowKeys,
931+ internalRadioSelectedRowKey,
932+ isVirtualScroll,
933+ isExpandRow : isExpandRow ( {
934+ rowData,
935+ rowIndex,
936+ } ) ,
937+ cellStyleOption,
938+ cellSpanOption : this . cellSpanOption ,
939+ highlightRowKey : this . highlightRowKey ,
940+ eventCustomOption : this . eventCustomOption ,
941+ cellSelectionKeyData : this . cellSelectionKeyData ,
942+ editOption : this . editOption ,
943+ editingCells : this . editingCells ,
944+ editingFocusCell : this . editingFocusCell ,
945+ columnCollection : this . columnCollection ,
946+ } ,
947+ } ;
948+
896949 if ( isScrolling ) {
897950 const trPropsScrolling = {
898951 key : this . getTrKey ( { rowData, rowIndex } ) ,
@@ -901,39 +954,19 @@ export default {
901954 } ,
902955 } ;
903956
904- return < BodyTrScrolling { ...trPropsScrolling } /> ;
957+ if (
958+ virtualScrollRepeatRenderedRowKeys . indexOf (
959+ rowData [ this . rowKeyFieldName ] ,
960+ ) != - 1
961+ ) {
962+ return [
963+ // body tr
964+ < BodyTr { ...trProps } /> ,
965+ ] ;
966+ } else {
967+ return < BodyTrScrolling { ...trPropsScrolling } /> ;
968+ }
905969 } else {
906- const trProps = {
907- key : this . getTrKey ( { rowData, rowIndex } ) ,
908- props : {
909- rowIndex,
910- rowData,
911- colgroups,
912- expandOption,
913- expandedRowkeys,
914- checkboxOption,
915- radioOption,
916- rowKeyFieldName,
917- expandRowChange,
918- internalCheckboxSelectedRowKeys,
919- internalRadioSelectedRowKey,
920- isVirtualScroll,
921- isExpandRow : isExpandRow ( {
922- rowData,
923- rowIndex,
924- } ) ,
925- cellStyleOption,
926- cellSpanOption : this . cellSpanOption ,
927- highlightRowKey : this . highlightRowKey ,
928- eventCustomOption : this . eventCustomOption ,
929- cellSelectionKeyData : this . cellSelectionKeyData ,
930- editOption : this . editOption ,
931- editingCells : this . editingCells ,
932- editingFocusCell : this . editingFocusCell ,
933- columnCollection : this . columnCollection ,
934- } ,
935- } ;
936-
937970 return [
938971 // body tr
939972 < BodyTr { ...trProps } /> ,
0 commit comments