From b095b0bc1dd04daab7e932d578c1581f8fa516e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Fri, 25 Jan 2019 17:13:49 +0800 Subject: [PATCH] add responsive-table (#3472) --- src/global.less | 19 +++++++++++++++++++ src/pages/List/TableList.js | 3 +-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/global.less b/src/global.less index fccd7e83..1450ba46 100644 --- a/src/global.less +++ b/src/global.less @@ -1,3 +1,5 @@ +@import '~antd/lib/style/themes/default.less'; + html, body, #root { @@ -31,3 +33,20 @@ ul, ol { list-style: none; } + +@media (max-width: @screen-xs) { + .ant-table { + width: 100%; + overflow-x: auto; + &-thead > tr, + &-tbody > tr { + > th, + > td { + white-space: pre; + > span { + display: block; + } + } + } + } +} diff --git a/src/pages/List/TableList.js b/src/pages/List/TableList.js index 13f5fb60..131d61aa 100644 --- a/src/pages/List/TableList.js +++ b/src/pages/List/TableList.js @@ -301,7 +301,6 @@ class TableList extends PureComponent { title: '服务调用次数', dataIndex: 'callNo', sorter: true, - align: 'right', render: val => `${val} 万`, // mark to display a total number needTotal: true, @@ -598,7 +597,7 @@ class TableList extends PureComponent {
-
+
-- GitLab