- {children}
-
- {menu.items?.map((item: any, idx: number) => (
-
- {item.label}
-
- ))}
+// mock antd components — 用 importActual 透传未显式覆盖的组件(Popover/Button/Tag/Typography/Badge 等),
+// 避免 Header 子组件(PointsBadge)使用新 antd 导出时出现 "No xxx export is defined on the antd mock"
+vi.mock("antd", async () => {
+ const actual = (await vi.importActual
("antd")) as Record
+ return {
+ ...actual,
+ Avatar: ({ children, className }: any) => (
+
+ {children}
+
+ ),
+ Dropdown: ({ children, menu }: any) => (
+
+ {children}
+
+ {menu.items?.map((item: any, idx: number) => (
+
+ {item.label}
+
+ ))}
+
-
- ),
- Space: ({ children, className }: any) => (
-
- {children}
-
- ),
- Drawer: ({ title, open, children, onClose, placement }: any) =>
- open ? (
-
-
{title}
-
+ ),
+ Space: ({ children, className }: any) => (
+
{children}
- ) : null,
-}))
+ ),
+ Drawer: ({ title, open, children, onClose, placement }: any) =>
+ open ? (
+
+
{title}
+
+ {children}
+
+ ) : null,
+ }
+})
// mock CSS
vi.mock("@/components/layout/Header.css", () => ({}))