From 78b336b25b81b75885948eaaa05e78a7db23f103 Mon Sep 17 00:00:00 2001 From: Aaron <427787340@qq.com> Date: Mon, 2 Sep 2019 14:46:20 +0800 Subject: [PATCH] 修复Scheme静态数据表格初始化数量 --- packages/scheme/index.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/scheme/index.vue b/packages/scheme/index.vue index ab8fdc5..a658905 100644 --- a/packages/scheme/index.vue +++ b/packages/scheme/index.vue @@ -384,9 +384,12 @@ export default { watch: { value(val) { if (!(this.option.searchAPI || _$http && this.option.url)) { - const valueData = val.map(item => { return { ...item, $pk: item[this.option.primaryKey] || item['$pk'] || getUUID() } }); - this.tableDataStatic = valueData; - this.tableData = valueData; + const resultData = val.map(item => { return { ...item, $pk: item[this.option.primaryKey] || item['$pk'] || getUUID() } }); + this.tableDataStatic = resultData; + const begin = (this.currentPage - 1) * this.pageSize; + const end = this.currentPage * this.pageSize; + this.tableData = resultData.slice(begin, end); + this.totalCount = resultData.length; } else { this.tableData = val; } -- libgit2 0.21.0