enhance(view):连续视图中的key改为自动生成的文件id。
This commit is contained in:
		| @@ -21,6 +21,7 @@ export const ContinuationView: FC = () => { | ||||
|     }, | ||||
|     [files] | ||||
|   ); | ||||
|   const fileHeights = useMemo(() => map(item => item.height * (zoom / 100), files), [files, zoom]); | ||||
|  | ||||
|   useEffect(() => { | ||||
|     ebus?.addListener('navigate_offset', ({ filename }) => { | ||||
| @@ -48,7 +49,8 @@ export const ContinuationView: FC = () => { | ||||
|         <VariableSizeList | ||||
|           itemData={files} | ||||
|           itemCount={fileCount} | ||||
|           itemSize={index => files[index].height * (zoom / 100)} | ||||
|           itemSize={index => fileHeights[index]} | ||||
|           itemKey={index => files[index].id} | ||||
|           height={viewHeight} | ||||
|           width="100%" | ||||
|           ref={virtualListRef} | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| export type FileItem = { | ||||
|   sort: number; | ||||
|   id: string; | ||||
|   filename: string; | ||||
|   path: string; | ||||
|   width: number; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user