Skip to content

Commit

Permalink
fix(virtual-list): keep alive reactivated (#137)
Browse files Browse the repository at this point in the history
* Update VirtualList.ts

* 格式化

* 滚动到记录位置
  • Loading branch information
doom-9-zz authored Feb 13, 2022
1 parent be6cb75 commit cf719fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/virtual-list/src/VirtualList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
ref,
onMounted,
h,
CSSProperties
CSSProperties,
onActivated
} from 'vue'
import { depx, pxfy, beforeNextFrameOnce } from 'seemly'
import { useMemo } from 'vooks'
Expand Down Expand Up @@ -124,6 +125,9 @@ export default defineComponent({
scrollTo({ key: defaultScrollKey })
}
})
onActivated(() => {
scrollTo({ top: scrollTopRef.value })
})
const keyIndexMapRef = computed(() => {
const map = new Map()
const { keyField } = props
Expand Down

1 comment on commit cf719fb

@vercel
Copy link

@vercel vercel bot commented on cf719fb Feb 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.