From 999db14732076a3a540fb91bbcf73e7b5188c420 Mon Sep 17 00:00:00 2001 From: lirilsu Date: Thu, 19 Oct 2017 13:54:21 +0800 Subject: [PATCH] Table: Move `append` slot out of `table-body` --- packages/table/src/table-body.js | 2 -- packages/table/src/table-layout.js | 4 +++- packages/table/src/table.vue | 11 +++++++++-- packages/theme-chalk/src/table.scss | 7 +++++++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/packages/table/src/table-body.js b/packages/table/src/table-body.js index 55ed6b2f4..6d618eb03 100644 --- a/packages/table/src/table-body.js +++ b/packages/table/src/table-body.js @@ -136,8 +136,6 @@ export default { ) : '' ] - ).concat( - this._self.$parent.$slots.append ).concat( ) diff --git a/packages/table/src/table-layout.js b/packages/table/src/table-layout.js index 48664630f..c01aed98e 100644 --- a/packages/table/src/table-layout.js +++ b/packages/table/src/table-layout.js @@ -16,6 +16,7 @@ class TableLayout { this.rightFixedWidth = null; this.tableHeight = null; this.headerHeight = 44; // Table Header Height + this.appendHeight = 0; // Append Slot Height this.footerHeight = 44; // Table Footer Height this.viewportHeight = null; // Table Height - Scroll Bar Height this.bodyHeight = null; // Table Height - Table Header Height @@ -74,8 +75,9 @@ class TableLayout { updateHeight() { const height = this.tableHeight = this.table.$el.clientHeight; const noData = !this.table.data || this.table.data.length === 0; - const { headerWrapper, footerWrapper } = this.table.$refs; + const { headerWrapper, appendWrapper, footerWrapper } = this.table.$refs; const footerHeight = this.footerHeight = footerWrapper ? footerWrapper.offsetHeight : 0; + this.appendHeight = appendWrapper ? appendWrapper.offsetHeight : 0; if (this.showHeader && !headerWrapper) return; if (!this.showHeader) { this.headerHeight = 0; diff --git a/packages/table/src/table.vue b/packages/table/src/table.vue index e4cf4a549..87c5942e4 100644 --- a/packages/table/src/table.vue +++ b/packages/table/src/table.vue @@ -40,6 +40,9 @@
{{ emptyText || t('el.table.emptyText') }}
+
+ +