From 49dd4a55eb6fc5a3440e8119b5d71196ca014ed4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=95=E9=87=91=E6=B3=BD?= <1098696801@qq.com>
Date: Fri, 12 Aug 2022 16:25:11 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmb-table=E6=89=93=E5=8C=85?=
=?UTF-8?q?=E4=B9=8B=E5=90=8Elimit=E9=80=89=E6=8B=A9=E6=97=A0=E6=95=88?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
magic-boot-ui/src/components/magic/data/mb-table.vue | 9 +++++----
1 file changed, 5 insertions(+), 4 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 ca55cff..22d3c57 100644
--- a/magic-boot-ui/src/components/magic/data/mb-table.vue
+++ b/magic-boot-ui/src/components/magic/data/mb-table.vue
@@ -32,7 +32,7 @@
-
+
@@ -102,6 +102,7 @@ const list = ref([])
const listLoading = ref(false)
const tableKey = ref(0)
let newWhere = reactive({})
+const _limit = ref(props.limit)
function renderWhere(){
newWhere = reactive(proxy.$common.renderWhere(props.where))
@@ -112,7 +113,7 @@ function getList() {
listLoading.value = true
if (props.page) {
newWhere.current = listCurrent.value
- newWhere.size = props.limit
+ newWhere.size = _limit.value
} else {
newWhere.size = 99999999
}
@@ -214,7 +215,7 @@ function handlerData() {
var currPageData = []
if(props.page){
props.data.forEach((it, i) => {
- if (i >= ((listCurrent.value - 1) * props.limit) && i < (listCurrent.value * props.limit) && currPageData.length < props.limit) {
+ if (i >= ((listCurrent.value - 1) * _limit.value) && i < (listCurrent.value * _limit.value) && currPageData.length < _limit.value) {
currPageData.push(it)
}
})
@@ -244,7 +245,7 @@ function keyup(){
handlerPagination()
}
} else if (e && e.keyCode == 39) {
- if(listCurrent.value != parseInt((total.value + props.limit - 1) / props.limit)){
+ if(listCurrent.value != parseInt((total.value + _limit.value - 1) / _limit.value)){
listCurrent.value += 1
handlerPagination()
}