@@ -458,6 +458,7 @@ export default (Vue as VueConstructor<Vue & {
458458 ready: false ,
459459 currentExpandState: false ,
460460
461+ expandRenderStart: 0 ,
461462 topNodes: [] as TreeNode [],
462463 middleNodes: [] as TreeNode [],
463464 bottomNodes: [] as TreeNode [],
@@ -945,6 +946,7 @@ export default (Vue as VueConstructor<Vue & {
945946 this .expandAnimation .index = - 1
946947 this .expandAnimation .level = - 1
947948
949+ this .expandAnimation .expandRenderStart = 0
948950 this .expandAnimation .topNodes = []
949951 this .expandAnimation .middleNodes = []
950952 this .expandAnimation .bottomNodes = []
@@ -954,7 +956,8 @@ export default (Vue as VueConstructor<Vue & {
954956 const nodeToExpandLevel = this .expandAnimation .level
955957 const middleNodes: TreeNode [] = []
956958 const renderNodesLength = this .renderNodes .length
957- for (let i = this .expandAnimation .index + 1 ; i < renderNodesLength ; i ++ ) {
959+ const expandRenderStartDiff = this .renderStart - this .expandAnimation .expandRenderStart
960+ for (let i = this .expandAnimation .index - expandRenderStartDiff + 1 ; i < renderNodesLength ; i ++ ) {
958961 if (this .renderNodes [i ]._level > nodeToExpandLevel ) {
959962 middleNodes .push (this .renderNodes [i ])
960963 } else break
@@ -974,6 +977,7 @@ export default (Vue as VueConstructor<Vue & {
974977 this .expandAnimation .start = true
975978 this .expandAnimation .currentExpandState = nodeToExpand .expand
976979 this .expandAnimation .nextState = ! nodeToExpand .expand
980+ this .expandAnimation .expandRenderStart = this .renderStart
977981
978982 if (this .expandAnimation .nextState ) {
979983 this .expandAnimation .bottomNodes = this .renderNodes .slice (this .expandAnimation .index + 1 )
@@ -994,11 +998,12 @@ export default (Vue as VueConstructor<Vue & {
994998 if (this .expandAnimation .index === - 1 ) return
995999
9961000 this .$nextTick (() => {
997- this .expandAnimation .topNodes = this .renderNodes .slice (0 , this .expandAnimation .index + 1 )
1001+ const expandRenderStartDiff = this .renderStart - this .expandAnimation .expandRenderStart
1002+ this .expandAnimation .topNodes = this .renderNodes .slice (0 , this .expandAnimation .index - expandRenderStartDiff + 1 )
9981003 if (this .expandAnimation .nextState ) {
9991004 this .updateMiddleNodes ()
10001005 } else {
1001- this .expandAnimation .bottomNodes = this .renderNodes .slice (this .expandAnimation .index + 1 )
1006+ this .expandAnimation .bottomNodes = this .renderNodes .slice (this .expandAnimation .index - expandRenderStartDiff + 1 )
10021007 }
10031008 this .expandAnimation .ready = true
10041009 this .$nextTick (() => {
0 commit comments