mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 10:59:42 +08:00
commit
39d38c03d5
@ -66,7 +66,15 @@ export class AsideNav extends React.Component<AsideNavProps, AsideNavState> {
|
||||
<ul className={cx('AsideNav-subList')}>
|
||||
{link.label ? (
|
||||
<li key="subHeader" className={cx('AsideNav-subHeader')}>
|
||||
<a>{link.label}</a>
|
||||
{renderLink(
|
||||
{
|
||||
...link,
|
||||
children: undefined
|
||||
},
|
||||
'subHeader',
|
||||
{},
|
||||
depth
|
||||
)}
|
||||
</li>
|
||||
) : null}
|
||||
{link.children.map((link, key) =>
|
||||
@ -183,6 +191,7 @@ export class AsideNav extends React.Component<AsideNavProps, AsideNavState> {
|
||||
toggleExpand: this.toggleExpand,
|
||||
depth,
|
||||
classnames: cx,
|
||||
subHeader: key === 'subHeader',
|
||||
...others
|
||||
});
|
||||
|
||||
|
@ -256,20 +256,17 @@ export default class App extends React.Component<AppProps, object> {
|
||||
{asideBefore ? render('aside-before', asideBefore) : null}
|
||||
<AsideNav
|
||||
navigations={store.navigations}
|
||||
renderLink={({
|
||||
link,
|
||||
active,
|
||||
toggleExpand,
|
||||
classnames: cx,
|
||||
depth
|
||||
}: any) => {
|
||||
renderLink={(
|
||||
{link, active, toggleExpand, classnames: cx, depth, subHeader}: any,
|
||||
key: any
|
||||
) => {
|
||||
let children = [];
|
||||
|
||||
if (link.visible === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (link.children && link.children.length) {
|
||||
if (!subHeader && link.children && link.children.length) {
|
||||
children.push(
|
||||
<span
|
||||
key="expand-toggle"
|
||||
@ -292,11 +289,11 @@ export default class App extends React.Component<AppProps, object> {
|
||||
</b>
|
||||
);
|
||||
|
||||
if (link.icon) {
|
||||
if (!subHeader && link.icon) {
|
||||
children.push(
|
||||
<i key="icon" className={cx(`AsideNav-itemIcon`, link.icon)} />
|
||||
);
|
||||
} else if (store.folded && depth === 1) {
|
||||
} else if (store.folded && depth === 1 && !subHeader) {
|
||||
children.push(
|
||||
<i
|
||||
key="icon"
|
||||
|
Loading…
Reference in New Issue
Block a user