From eedcba586c535e1517dfb1fc9e6b2f4ac22ea520 Mon Sep 17 00:00:00 2001 From: Rijn Date: Mon, 2 Jan 2017 13:42:32 -0600 Subject: [PATCH] Added ellipsis property to table column --- src/components/table/cell.vue | 3 ++- src/styles/components/table.less | 9 ++++++++- test/routers/table.vue | 61 +++++++++++++++++++++++++++++++++++++------------------------ 3 files changed, 47 insertions(+), 26 deletions(-) diff --git a/src/components/table/cell.vue b/src/components/table/cell.vue index 2c17edb..cbe7959 100644 --- a/src/components/table/cell.vue +++ b/src/components/table/cell.vue @@ -36,7 +36,8 @@ return [ `${this.prefixCls}-cell`, { - [`${this.prefixCls}-hidden`]: !this.fixed && this.column.fixed && (this.column.fixed === 'left' || this.column.fixed === 'right') + [`${this.prefixCls}-hidden`]: !this.fixed && this.column.fixed && (this.column.fixed === 'left' || this.column.fixed === 'right'), + [`${this.prefixCls}-cell-ellipsis`]: this.column.ellipsis || false } ]; } diff --git a/src/styles/components/table.less b/src/styles/components/table.less index b6030e2..f6a47e4 100644 --- a/src/styles/components/table.less +++ b/src/styles/components/table.less @@ -138,6 +138,13 @@ white-space: normal; word-break: break-all; box-sizing: border-box; + + &-ellipsis { + word-break: keep-all; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } } &-hidden{ visibility: hidden; @@ -298,4 +305,4 @@ padding: 0; } } -} \ No newline at end of file +} diff --git a/test/routers/table.vue b/test/routers/table.vue index 844a9d0..ed16185 100644 --- a/test/routers/table.vue +++ b/test/routers/table.vue @@ -1,5 +1,6 @@