This commit is contained in:
2026-05-24 05:15:53 +08:00
parent 3bee6aaf18
commit 8351498071
3 changed files with 27 additions and 1 deletions

15
Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM node:24-alpine
WORKDIR /app
# 1. 启用 pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
# 2. 复制 workspace 配置
COPY pnpm-workspace.yaml pnpm-lock.yaml package.json ./
# 3. 安装所有依赖
RUN pnpm install --frozen-lockfile
# 4. 复制源码
COPY . .

10
docker-compose.yml Normal file
View File

@@ -0,0 +1,10 @@
services:
dev:
image: node:24-alpine
working_dir: /app
volumes:
- .:/app
- /app/node_modules
ports:
- "3000:3000"
command: sh

View File

@@ -14,9 +14,10 @@ export function useButtonSlot(
props: { hideIcon?: boolean; loading?: boolean }, props: { hideIcon?: boolean; loading?: boolean },
) { ) {
const filterNodes = (nodes: ReactNode): ReactNode => { const filterNodes = (nodes: ReactNode): ReactNode => {
// 存储挑出 Slot 后的纯净 children
const filtered: ReactNode[] = []; const filtered: ReactNode[] = [];
Children.forEach(nodes, (child) => { Children.forEach(nodes, (child: any) => {
if (!isValidElement(child)) { if (!isValidElement(child)) {
filtered.push(child); filtered.push(child);
return; return;