File tree 3 files changed +5
-3
lines changed
3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,10 @@ export default {
33
33
} ,
34
34
35
35
methods : {
36
- onColumnsChange ( ) {
36
+ onColumnsChange ( layout ) {
37
37
const cols = this . $el . querySelectorAll ( 'colgroup > col' ) ;
38
38
if ( ! cols . length ) return ;
39
- const flattenColumns = this . tableLayout . getFlattenColumns ( ) ;
39
+ const flattenColumns = layout . getFlattenColumns ( ) ;
40
40
const columnsMap = { } ;
41
41
flattenColumns . forEach ( ( column ) => {
42
42
columnsMap [ column . id ] = column ;
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ class TableLayout {
97
97
if ( this . showHeader && ! headerWrapper ) return ;
98
98
99
99
// fix issue (https://github.com/ElemeFE/element/pull/16956)
100
- const headerTrElm = headerWrapper . querySelector ( '.el-table__header tr' ) ;
100
+ const headerTrElm = headerWrapper ? headerWrapper . querySelector ( '.el-table__header tr' ) : null ;
101
101
const noneHeader = this . headerDisplayNone ( headerTrElm ) ;
102
102
103
103
const headerHeight = this . headerHeight = ! this . showHeader ? 0 : headerWrapper . offsetHeight ;
@@ -119,6 +119,7 @@ class TableLayout {
119
119
}
120
120
121
121
headerDisplayNone ( elm ) {
122
+ if ( ! elm ) return true ;
122
123
let headerChild = elm ;
123
124
while ( headerChild . tagName !== 'DIV' ) {
124
125
if ( getComputedStyle ( headerChild ) . display === 'none' ) {
Original file line number Diff line number Diff line change 383
383
updateScrollY () {
384
384
const changed = this .layout .updateScrollY ();
385
385
if (changed) {
386
+ this .layout .notifyObservers (' scrollable' );
386
387
this .layout .updateColumnsWidth ();
387
388
}
388
389
},
You can’t perform that action at this time.
0 commit comments