From ff61fe327a4e0380df0d17efe5f39231c9d8dd6b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?kiner-tang=28=E6=96=87=E8=BE=89=29?= <1127031143@qq.com>
Date: Tue, 27 Dec 2022 14:49:55 +0800
Subject: [PATCH 1/3] fix: tree switcher's background display unexpected in
drak theme
---
components/tree/demo/basic-dark.tsx | 66 +++++++++++++++++++++++++++++
components/tree/index.zh-CN.md | 1 +
components/tree/style/index.tsx | 2 +-
3 files changed, 68 insertions(+), 1 deletion(-)
create mode 100644 components/tree/demo/basic-dark.tsx
diff --git a/components/tree/demo/basic-dark.tsx b/components/tree/demo/basic-dark.tsx
new file mode 100644
index 000000000000..0ba7c6e56b5a
--- /dev/null
+++ b/components/tree/demo/basic-dark.tsx
@@ -0,0 +1,66 @@
+import React from 'react';
+import { Tree, ConfigProvider, theme } from 'antd';
+import type { DataNode, TreeProps } from 'antd/es/tree';
+
+const { darkAlgorithm } = theme;
+
+const treeData: DataNode[] = [
+ {
+ title: 'parent 1',
+ key: '0-0',
+ children: [
+ {
+ title: 'parent 1-0',
+ key: '0-0-0',
+ disabled: true,
+ children: [
+ {
+ title: 'leaf',
+ key: '0-0-0-0',
+ disableCheckbox: true,
+ },
+ {
+ title: 'leaf',
+ key: '0-0-0-1',
+ },
+ ],
+ },
+ {
+ title: 'parent 1-1',
+ key: '0-0-1',
+ children: [{ title: sss, key: '0-0-1-0' }],
+ },
+ ],
+ },
+];
+
+const App: React.FC = () => {
+ const onSelect: TreeProps['onSelect'] = (selectedKeys, info) => {
+ console.log('selected', selectedKeys, info);
+ };
+
+ const onCheck: TreeProps['onCheck'] = (checkedKeys, info) => {
+ console.log('onCheck', checkedKeys, info);
+ };
+
+ return (
+
+
+
+ );
+};
+
+export default App;
diff --git a/components/tree/index.zh-CN.md b/components/tree/index.zh-CN.md
index 5066acd18d19..989a71a7007b 100644
--- a/components/tree/index.zh-CN.md
+++ b/components/tree/index.zh-CN.md
@@ -18,6 +18,7 @@ demo:
基本
+基本-暗色模式
受控操作示例
拖动示例
异步数据加载
diff --git a/components/tree/style/index.tsx b/components/tree/style/index.tsx
index 5e50d89d8451..c2b96ad945ed 100644
--- a/components/tree/style/index.tsx
+++ b/components/tree/style/index.tsx
@@ -347,7 +347,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject =>
// ============== Cover Background ==============
[`${treeCls}-switcher`]: {
- background: token.colorBgContainer,
+ background: 'transparent',
'&-line-icon': {
// https://github.com/ant-design/ant-design/issues/32813
From 94cfa97bf69f64b1799c88d2ae31a93c4754e369 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?kiner-tang=28=E6=96=87=E8=BE=89=29?= <1127031143@qq.com>
Date: Tue, 27 Dec 2022 14:54:19 +0800
Subject: [PATCH 2/3] fix: tree switcher's background display unexpected in
drak theme
---
components/tree/demo/basic-dark.tsx | 1 -
1 file changed, 1 deletion(-)
diff --git a/components/tree/demo/basic-dark.tsx b/components/tree/demo/basic-dark.tsx
index 0ba7c6e56b5a..eb0cee992e7a 100644
--- a/components/tree/demo/basic-dark.tsx
+++ b/components/tree/demo/basic-dark.tsx
@@ -57,7 +57,6 @@ const App: React.FC = () => {
onSelect={onSelect}
onCheck={onCheck}
treeData={treeData}
- rootStyle={{ background: 'gray' }}
/>
);
From 56ebff08545bca94cfd603c91986ceb9078c76a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?kiner-tang=28=E6=96=87=E8=BE=89=29?= <1127031143@qq.com>
Date: Tue, 27 Dec 2022 15:31:43 +0800
Subject: [PATCH 3/3] feat: remove demo
---
components/tree/demo/basic-dark.tsx | 65 -----------------------------
components/tree/index.zh-CN.md | 1 -
2 files changed, 66 deletions(-)
delete mode 100644 components/tree/demo/basic-dark.tsx
diff --git a/components/tree/demo/basic-dark.tsx b/components/tree/demo/basic-dark.tsx
deleted file mode 100644
index eb0cee992e7a..000000000000
--- a/components/tree/demo/basic-dark.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import React from 'react';
-import { Tree, ConfigProvider, theme } from 'antd';
-import type { DataNode, TreeProps } from 'antd/es/tree';
-
-const { darkAlgorithm } = theme;
-
-const treeData: DataNode[] = [
- {
- title: 'parent 1',
- key: '0-0',
- children: [
- {
- title: 'parent 1-0',
- key: '0-0-0',
- disabled: true,
- children: [
- {
- title: 'leaf',
- key: '0-0-0-0',
- disableCheckbox: true,
- },
- {
- title: 'leaf',
- key: '0-0-0-1',
- },
- ],
- },
- {
- title: 'parent 1-1',
- key: '0-0-1',
- children: [{ title: sss, key: '0-0-1-0' }],
- },
- ],
- },
-];
-
-const App: React.FC = () => {
- const onSelect: TreeProps['onSelect'] = (selectedKeys, info) => {
- console.log('selected', selectedKeys, info);
- };
-
- const onCheck: TreeProps['onCheck'] = (checkedKeys, info) => {
- console.log('onCheck', checkedKeys, info);
- };
-
- return (
-
-
-
- );
-};
-
-export default App;
diff --git a/components/tree/index.zh-CN.md b/components/tree/index.zh-CN.md
index 989a71a7007b..5066acd18d19 100644
--- a/components/tree/index.zh-CN.md
+++ b/components/tree/index.zh-CN.md
@@ -18,7 +18,6 @@ demo:
基本
-基本-暗色模式
受控操作示例
拖动示例
异步数据加载