From c9096c19c326106cdd9bc49bc0a592fb0706b4d6 Mon Sep 17 00:00:00 2001
From: qinhaoyan <30946345+qinhaoyan@users.noreply.github.com>
Date: Mon, 22 Jan 2024 16:40:20 +0800
Subject: [PATCH] =?UTF-8?q?tree\nav=E6=94=AF=E6=8C=81svg=20icon?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/amis-ui/scss/components/_menu.scss | 3 +++
packages/amis-ui/src/components/Tree.tsx | 10 +---------
packages/amis/src/renderers/Nav.tsx | 2 +-
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/packages/amis-ui/scss/components/_menu.scss b/packages/amis-ui/scss/components/_menu.scss
index db8cabdc4..ff9d75a8d 100644
--- a/packages/amis-ui/scss/components/_menu.scss
+++ b/packages/amis-ui/scss/components/_menu.scss
@@ -230,6 +230,9 @@
svg {
float: left;
}
+ svg {
+ top: 0;
+ }
}
&-item-icon {
diff --git a/packages/amis-ui/src/components/Tree.tsx b/packages/amis-ui/src/components/Tree.tsx
index 5b1588293..2ddf8fac3 100644
--- a/packages/amis-ui/src/components/Tree.tsx
+++ b/packages/amis-ui/src/components/Tree.tsx
@@ -1242,15 +1242,7 @@ export class TreeSelector extends React.Component<
: this.handleSelect(item))
}
>
- {iconValue ? (
- getIcon(iconValue) ? (
-
- ) : React.isValidElement(iconValue) ? (
- iconValue
- ) : (
-
- )
- ) : null}
+ {iconValue ? : null}
) : null}
diff --git a/packages/amis/src/renderers/Nav.tsx b/packages/amis/src/renderers/Nav.tsx
index a13889c8d..7fa5beb6e 100644
--- a/packages/amis/src/renderers/Nav.tsx
+++ b/packages/amis/src/renderers/Nav.tsx
@@ -655,7 +655,7 @@ export class Navigation extends React.Component<
);