小修改

This commit is contained in:
王佑琳 2026-05-05 15:04:59 +08:00
parent c000a8c19f
commit 0a996eac08
3 changed files with 10 additions and 4 deletions

2
components.d.ts vendored
View File

@ -11,7 +11,9 @@ export {}
/* prettier-ignore */ /* prettier-ignore */
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
2: typeof import('./src/components/virtual-scroller/VirtualScroller copy 2.vue')['default']
Canvas: typeof import('./src/components/canvas/index.vue')['default'] Canvas: typeof import('./src/components/canvas/index.vue')['default']
copy: typeof import('./src/components/virtual-scroller/VirtualScroller copy.vue')['default']
DialogBox: typeof import('./src/components/dialogBox/index.vue')['default'] DialogBox: typeof import('./src/components/dialogBox/index.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker']

View File

@ -202,20 +202,22 @@ const visibleRange = computed(() => {
} }
offset = startOffset offset = startOffset
endIndex = startIndex
for (let i = startIndex; i < computedData.value.length; i++) { for (let i = startIndex; i < computedData.value.length; i++) {
const cachedHeight = itemHeights.value.get(i) const cachedHeight = itemHeights.value.get(i)
const height = cachedHeight !== undefined ? cachedHeight : props.estimatedHeight const height = cachedHeight !== undefined ? cachedHeight : props.estimatedHeight
if (offset >= currentScrollTop + viewportHeight) { offset += height
if (offset > currentScrollTop + viewportHeight) {
endIndex = Math.min(computedData.value.length - 1, i + bufferCount) endIndex = Math.min(computedData.value.length - 1, i + bufferCount)
break break
} }
offset += height
endIndex = i endIndex = i
} }
return { start: startIndex, end: endIndex, offset: startOffset } return { start: Math.min(startIndex, endIndex), end: Math.max(startIndex, endIndex), offset: startOffset }
}) })
const visibleItems = computed(() => { const visibleItems = computed(() => {

View File

@ -16,7 +16,9 @@ export async function Playload(data) {
nodeInfoList.push(json.nodeInfoList[key.name]) nodeInfoList.push(json.nodeInfoList[key.name])
} }
} }
json.nodeInfoList.index.fieldValue = data.imgs.length - 1 if (json.nodeInfoList.index) {
json.nodeInfoList.index.fieldValue = data.imgs.length - 1
}
} }
if (Array.isArray(data.params)) { if (Array.isArray(data.params)) {