也许你可以添加这样的样式。 祝你好运。
import React from "react";
import {
AppstoreOutlined,
MailOutlined,
SettingOutlined
} from "@ant-design/icons";
import { Menu } from "antd";
import "./styles.css";
function getItem(label, key, icon, children, type) {
return {
key,
icon,
children,
label,
type
};
}
const items = [
getItem("Navigation One", "sub1", <MailOutlined />, [
getItem(
"Item 1",
"g1",
null,
[getItem("Option 1", "1"), getItem("Option 2", "2")],
"group"
)
]),
];
const App = () => {
const onClick = (e) => {
console.log("click ", e);
};
return (
<Menu
onClick={onClick}
style={{
width: 256
}}
mode="inline"
items={items}
/>
);
};
export default App;
.ant-menu-item-group-list .ant-menu-item {
border-right: 5px solid green;
}