fix: 修复上传文档懒加载无法加载第二页 (#407)

This commit is contained in:
shaohuzhang1 2024-05-09 20:45:14 +08:00 committed by GitHub
parent b123f0fa2f
commit 18861b45db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 20 deletions

View File

@ -4,7 +4,7 @@
:size="paragraph_list.length" :size="paragraph_list.length"
:total="modelValue.length" :total="modelValue.length"
:page_size="page_size" :page_size="page_size"
v-model:current_page="current_page" v-bind:current_page="current_page"
@load="next()" @load="next()"
:loading="loading" :loading="loading"
> >

View File

@ -1,6 +1,6 @@
<template> <template>
<el-tabs v-model="activeName" class="paragraph-tabs"> <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"> <el-tab-pane :label="item.name" :name="index">
<template #label> <template #label>
<div class="flex-center"> <div class="flex-center">
@ -21,11 +21,11 @@
</el-tabs> </el-tabs>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, watch } from 'vue' import { ref } from 'vue'
import { getImgUrl } from '@/utils/utils' import { getImgUrl } from '@/utils/utils'
import ParagraphList from './ParagraphList.vue' import ParagraphList from './ParagraphList.vue'
const props = defineProps({ defineProps({
data: { data: {
type: Array<any>, type: Array<any>,
default: () => [] default: () => []
@ -33,23 +33,7 @@ const props = defineProps({
isConnect: Boolean isConnect: Boolean
}) })
const emit = defineEmits(['update:data'])
const activeName = ref(0) const activeName = ref(0)
const newData = ref<any[]>([])
watch(
() => props.data,
(value) => {
newData.value = value
},
{
immediate: true
}
)
onMounted(() => {})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.paragraph-tabs { .paragraph-tabs {