fix: optimize data loading in ParagraphList component

This commit is contained in:
CaptainB 2025-07-10 14:54:32 +08:00
parent 79537cade9
commit 28a909e226

View File

@ -70,14 +70,20 @@ const props = defineProps({
knowledgeId: String
})
//
watchEffect(() => {
if (props.modelValue && props.modelValue.length > 0) {
const end = page_size.value * current_page.value;
localParagraphList.value = props.modelValue.slice(0, Math.min(end, props.modelValue.length));
}
})
//
watchEffect(() => {
const start = 0;
const end = page_size.value * current_page.value;
//
if (end <= props.modelValue.length) {
localParagraphList.value = props.modelValue.slice(start, end);
}
//
localParagraphList.value = props.modelValue.slice(start, Math.min(end, props.modelValue.length));
})
const paragraph_list = computed(() => {