houzhongjian
2024-11-21 019e51eac5228b87f85b4602cd21bc7f5c5d7665
1
2
3
4
5
6
7
8
export const setIndex = (reserveIndex: boolean, index: number, size: number, current: number) => {
  const newIndex = index + 1
  if (reserveIndex) {
    return size * (current - 1) + newIndex
  } else {
    return newIndex
  }
}