From 011585f4bfbda642858000669d8532cd71a33d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E5=A3=B0?= Date: Fri, 22 Oct 2021 16:26:08 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=E6=96=91=E9=A9=AC=E7=BA=B9?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E4=B8=8Eng=E4=BF=9D=E6=8C=81=E4=B8=80?= =?UTF-8?q?=E8=87=B4=EF=BC=9B=E5=A2=9E=E5=8A=A0=E8=A1=A8=E5=A4=B4=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devui/table/src/header/header.scss | 8 ++++++++ devui/table/src/table.type.ts | 4 ++++ devui/table/src/use-table.ts | 1 + docs/.vitepress/devui-theme/styles/layout.scss | 4 ---- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/devui/table/src/header/header.scss b/devui/table/src/header/header.scss index fc10e53a..21e88bf4 100644 --- a/devui/table/src/header/header.scss +++ b/devui/table/src/header/header.scss @@ -16,3 +16,11 @@ } } } + +.header-bg { + thead.devui-thead { + tr { + background: var(--devui-list-item-hover-bg, #f2f5fc); + } + } +} diff --git a/devui/table/src/table.type.ts b/devui/table/src/table.type.ts index 563b9bb6..217b77e8 100644 --- a/devui/table/src/table.type.ts +++ b/devui/table/src/table.type.ts @@ -9,6 +9,10 @@ export const TableProps = { type: Boolean, default: false, }, + headerBg:{ + type: Boolean, + default: false + } }; export type TablePropsTypes = ExtractPropTypes; diff --git a/devui/table/src/use-table.ts b/devui/table/src/use-table.ts index c5e9f1e6..595302b6 100644 --- a/devui/table/src/use-table.ts +++ b/devui/table/src/use-table.ts @@ -5,6 +5,7 @@ export function useTable(props: TablePropsTypes): any { const classes = computed(() => ({ 'devui-table': true, 'devui-table-striped': props.striped, + 'header-bg': props.headerBg })); return { classes }; diff --git a/docs/.vitepress/devui-theme/styles/layout.scss b/docs/.vitepress/devui-theme/styles/layout.scss index 8f0ef7a5..2c5b027a 100644 --- a/docs/.vitepress/devui-theme/styles/layout.scss +++ b/docs/.vitepress/devui-theme/styles/layout.scss @@ -183,10 +183,6 @@ tr { border-top: 1px solid $devui-dividing-line; } -tr:nth-child(2n) { - background-color: $devui-area; -} - th, td { border: 1px solid $devui-dividing-line; -- Gitee From 4106a0805402772c1156a8525b2068f0fec81afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E5=A3=B0?= Date: Fri, 22 Oct 2021 16:27:04 +0800 Subject: [PATCH 2/7] =?UTF-8?q?docs:=20=E4=BF=AE=E6=94=B9=E2=80=9D?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=A0=B7=E5=BC=8F=E2=80=9C=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/components/table/index.md | 38 +++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/docs/components/table/index.md b/docs/components/table/index.md index 9492d1cf..afc60705 100644 --- a/docs/components/table/index.md +++ b/docs/components/table/index.md @@ -62,13 +62,23 @@ ::: -### 斑马纹表格 +### 表格样式 -:::demo 通过`d-table`组件上的`striped`属性,可设置带斑马纹的表格,更容易区分不同行的数据。 +:::demo ```vue