fix: sidebar menu text overflow (#3626)

This commit is contained in:
jack zhang 2024-03-06 14:37:13 +08:00 committed by GitHub
parent bcb445644c
commit d3627c5ba9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -27,8 +27,19 @@ export const SchemaInitializerButton: FC<SchemaInitializerButtonProps> = React.m
}} }}
icon={typeof options.icon === 'string' ? <Icon type={options.icon as string} /> : options.icon} icon={typeof options.icon === 'string' ? <Icon type={options.icon as string} /> : options.icon}
{...others} {...others}
>
<span
style={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
display: 'inline-block',
width: options.icon ? 'calc(100% - 14px)' : '100%',
verticalAlign: 'bottom',
}}
> >
{compile(options.title)} {compile(options.title)}
</span>
</Button> </Button>
); );
}); });

View File

@ -8,6 +8,9 @@ export const menuItemInitializer = new SchemaInitializer({
insertPosition: 'beforeEnd', insertPosition: 'beforeEnd',
icon: 'PlusOutlined', icon: 'PlusOutlined',
title: '{{t("Add menu item")}}', title: '{{t("Add menu item")}}',
style: {
width: '100%',
},
items: [ items: [
{ {
name: 'group', name: 'group',