From 5192e4c82b04c3e870ee9724d55c2e18878a0c5c Mon Sep 17 00:00:00 2001 From: Aaron <427787340@qq.com> Date: Mon, 2 Sep 2019 15:39:42 +0800 Subject: [PATCH] 优化静态表格维护传值 --- packages/scheme/index.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/scheme/index.vue b/packages/scheme/index.vue index a658905..8abf529 100644 --- a/packages/scheme/index.vue +++ b/packages/scheme/index.vue @@ -398,8 +398,17 @@ export default { methods: { // 向上反馈组件值 emit() { - this.$emit("input", this.tableData); - this.$emit("change", this.tableData); + if (!(this.option.searchAPI || _$http && this.option.url)) { + const resultData = this.tableDataStatic; + const begin = (this.currentPage - 1) * this.pageSize; + const end = this.currentPage * this.pageSize; + const value = resultData.slice(begin, end); + this.$emit("input", value); + this.$emit("change", value); + } else { + this.$emit("input", this.tableData); + this.$emit("change", this.tableData); + } }, // 动态改变表格列 dynamicChange() { -- libgit2 0.21.0