Skip to content

Commit

Permalink
fix: 修复上传文档懒加载无法加载第二页 (1Panel-dev#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaohuzhang1 committed May 9, 2024
1 parent b123f0f commit 18861b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion ui/src/views/dataset/component/ParagraphList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:size="paragraph_list.length"
:total="modelValue.length"
:page_size="page_size"
v-model:current_page="current_page"
v-bind:current_page="current_page"
@load="next()"
:loading="loading"
>
Expand Down
22 changes: 3 additions & 19 deletions ui/src/views/dataset/component/ParagraphPreview.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<el-tabs v-model="activeName" class="paragraph-tabs">
<template v-for="(item, index) in newData" :key="index">
<template v-for="(item, index) in data" :key="index">
<el-tab-pane :label="item.name" :name="index">
<template #label>
<div class="flex-center">
Expand All @@ -21,35 +21,19 @@
</el-tabs>
</template>
<script setup lang="ts">
import { ref, onMounted, watch } from 'vue'
import { ref } from 'vue'
import { getImgUrl } from '@/utils/utils'
import ParagraphList from './ParagraphList.vue'
const props = defineProps({
defineProps({
data: {
type: Array<any>,
default: () => []
},
isConnect: Boolean
})
const emit = defineEmits(['update:data'])
const activeName = ref(0)
const newData = ref<any[]>([])
watch(
() => props.data,
(value) => {
newData.value = value
},
{
immediate: true
}
)
onMounted(() => {})
</script>
<style scoped lang="scss">
.paragraph-tabs {
Expand Down

0 comments on commit 18861b4

Please sign in to comment.