From 2aca3f0e78fc975b9ecbc357f46833092f73869c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E9=87=91=E6=B3=BD?= <1098696801@qq.com> Date: Sun, 22 May 2022 22:19:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmb-table=E9=9D=99=E6=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=86=E9=A1=B5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/magic/data/mb-table.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/magic-boot-ui/src/components/magic/data/mb-table.vue b/magic-boot-ui/src/components/magic/data/mb-table.vue index 2668b59..ca55cff 100644 --- a/magic-boot-ui/src/components/magic/data/mb-table.vue +++ b/magic-boot-ui/src/components/magic/data/mb-table.vue @@ -212,11 +212,15 @@ function handlerData() { listLoading.value = true total.value = props.data.length var currPageData = [] - props.data.forEach((it, i) => { - if (i >= ((listCurrent.value - 1) * props.limit) && i < (listCurrent.value * props.limit) && currPageData.length < props.limit) { - currPageData.push(it) - } - }) + if(props.page){ + props.data.forEach((it, i) => { + if (i >= ((listCurrent.value - 1) * props.limit) && i < (listCurrent.value * props.limit) && currPageData.length < props.limit) { + currPageData.push(it) + } + }) + }else{ + currPageData = props.data + } list.value = currPageData props.done() listLoading.value = false