Ant Design的Typography.Paragraph组件默认是一个段落文本的样式,不适合作为菜单标题。但是你可以使用其他的Ant Design组件来实现多行菜单标题,例如Typography.Text或Typography.Title。
下面是一个使用Typography.Text组件实现多行菜单标题的示例代码:
import { Menu, Typography } from 'antd';
import { MailOutlined, AppstoreOutlined, SettingOutlined } from '@ant-design/icons';
const { SubMenu } = Menu;
const { Text } = Typography;
const App = () => {
return (
);
}
export default App;
在上面的示例中,我们将多行文本作为Typography.Text组件的内容传递给菜单标题的title属性。
注意:如果你需要更多自定义样式的菜单标题,你也可以使用其他的HTML/CSS技术来实现。