From f7c455535f345b65e763c086737ca167cda3727b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Thu, 16 Jul 2020 20:10:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scroll/index.wc | 2 +- src/table/index.wc | 24 ++++++++++++++++++++---- src/table/td.wc | 18 +++++++++--------- src/table/tr.wc | 24 ++++++++++++++---------- 4 files changed, 44 insertions(+), 24 deletions(-) diff --git a/src/scroll/index.wc b/src/scroll/index.wc index f7539d3..597d397 100644 --- a/src/scroll/index.wc +++ b/src/scroll/index.wc @@ -1,5 +1,5 @@ diff --git a/src/table/index.wc b/src/table/index.wc index d64b0c5..97a9928 100644 --- a/src/table/index.wc +++ b/src/table/index.wc @@ -13,19 +13,35 @@ color: nth($cd, 1); } .table { - overflow: hidden; - flex: 1; display: flex; flex-direction: column; - border: 1px solid nth($cp, 3); + width: 100%; + height: 100%; .thead, .tfoot { + overflow: hidden; width: 100%; + border: 1px solid nth($cp, 3); + --border-bottom: 0; background: nth($cp, 1); user-select: none; -moz-user-select: none; } + .thead { + border-bottom: 0; + } + .tfoot { + display: none; + border-top: 0; + } + .tbody { + border: 1px solid nth($cp, 3); + + ::slotted(wc-tr:last-child) { + --border-bottom: 0; + } + } } @@ -63,7 +79,7 @@ export default class Table { } else { w = '' } - return `${name}` + return `${name}` }) .join('') } diff --git a/src/table/td.wc b/src/table/td.wc index 7e62a86..2fad6cc 100644 --- a/src/table/td.wc +++ b/src/table/td.wc @@ -8,9 +8,15 @@ display: flex; align-items: center; min-width: 60px; - min-height: 36px; - border-right: 1px solid nth($cp, 3); - border-top: 1px solid nth($cp, 3); + // height: auto; + border-left: 1px solid nth($cp, 3); + + .cell { + min-height: 36px; + padding: 3px 5px; + word-wrap: break-word; + word-break: break-all; + } } :host([flex='2']) { flex: 2; @@ -39,12 +45,6 @@ :host([align='right']) { justify-content: flex-end; } - -.cell { - padding: 3px 5px; - word-wrap: break-word; - word-break: break-all; -}