@@ -14,6 +14,8 @@ import Footer from "./footer";
1414import { KEY_CODES } from "../../src/utils/constant" ;
1515import { isEmptyValue } from "../../src/utils/index" ;
1616import clickoutside from "../../src/directives/clickoutside" ;
17+ import { mutations } from "./util/store" ;
18+ import VueDomResizeObserver from "../../src/comps/resize-observer" ;
1719
1820// virtual scroll positions
1921let virtualScrollPositions = [
@@ -404,6 +406,10 @@ export default {
404406 return this . colgroups . some (
405407 x => x . fixed === "left" || x . fixed === "right"
406408 ) ;
409+ } ,
410+ // is last left fixed column
411+ hasLeftFixedColumn ( ) {
412+ return this . colgroups . some ( x => x . fixed === "left" ) ;
407413 }
408414 } ,
409415 watch : {
@@ -751,12 +757,39 @@ export default {
751757 getVirtualViewPhantom ( ) {
752758 let content = null ;
753759
754- if ( this . isVirtualScroll ) {
760+ /*
761+ 1、is virtualScroll
762+ or
763+ 2、
764+ has left fixed column and expand option(resolve expand row content sticky)
765+ */
766+ if (
767+ this . isVirtualScroll ||
768+ ( this . hasLeftFixedColumn && this . expandOption )
769+ ) {
770+ const props = {
771+ props : {
772+ tagName : "div"
773+ } ,
774+ style : {
775+ width : "100%"
776+ } ,
777+ on : {
778+ "on-dom-resize-change" : ( { width } ) => {
779+ mutations . setStore ( {
780+ tableViewportWidth : width
781+ } ) ;
782+ }
783+ }
784+ } ;
785+
755786 content = (
756787 < div
757788 ref = { this . virtualPhantomRef }
758789 class = { clsName ( "virtual-phantom" ) }
759- > </ div >
790+ >
791+ < VueDomResizeObserver { ...props } />
792+ </ div >
760793 ) ;
761794 }
762795
0 commit comments