From a84313109a09ad1da5223fc169440a38501039e4 Mon Sep 17 00:00:00 2001 From: huayj Date: Sat, 24 Aug 2019 16:21:57 +0800 Subject: [PATCH] =?UTF-8?q?column=E6=96=B0=E5=A2=9Erequired=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=8E=A7=E5=88=B6=E6=A0=87=E9=A2=98=E7=BA=A2=E8=89=B2?= =?UTF-8?q?=E6=98=9F=E5=8F=B7=E7=9A=84=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Table.js | 1 + src/Table.scss | 4 ++++ src/TableHeader.js | 1 + 3 files changed, 6 insertions(+) diff --git a/src/Table.js b/src/Table.js index de9b807..5fa33f0 100644 --- a/src/Table.js +++ b/src/Table.js @@ -482,6 +482,7 @@ class Table extends Component { dataindex:column.dataIndex, textAlign:column.textAlign, titleAlign: column.titleAlign, // 标题水平对齐方式 + required: column.required, // 标题是否展示必填标志 }; if (column.onHeadCellClick) { cell.onClick = column.onHeadCellClick; diff --git a/src/Table.scss b/src/Table.scss index 9180677..4b8465e 100644 --- a/src/Table.scss +++ b/src/Table.scss @@ -466,6 +466,9 @@ $icon-color:#505F79; // overflow: hidden; // white-space: nowrap; // text-overflow: ellipsis; + .required { + color: #F22C1D; + } .bee-table-column-sorter { position: relative; margin-left: 4px; @@ -487,6 +490,7 @@ $icon-color:#505F79; width: 34px; cursor: pointer; } + } diff --git a/src/TableHeader.js b/src/TableHeader.js index 2fa66f7..e774874 100644 --- a/src/TableHeader.js +++ b/src/TableHeader.js @@ -784,6 +784,7 @@ class TableHeader extends Component { if(!da.fixed ){ return ( + {da.required ? *:''} {da.children} { dragborder && columIndex != _rowLeng?
(this.gap = el)} data-line-key={da.key}