「项目案例」包含在 Pro 里,开通会员后显示预览。
用法
import { PortfolioCase } from './PortfolioCase.jsx'
<PortfolioCase
locale="en"
study={study} // { title, summary, client, year, role, tags, problem, steps, outcomes, before, after, next }
loading={!study}
error={loadError}
onRetry={reload}
onNext={(next) => router.push('/work/' + next.slug)}
/>属性
| 属性 | 类型 | 默认值 | 作用 |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | 内置文字和示例案例的语言。 |
study | { title, summary, client, year, role, tags, problem, steps: [{ title, text }], outcomes: [{ value, label }], before, after, next: { title, kind } } | null | sample case | 案例内容。每一部分都可省略,缺了对应的段落就不显示;传 null 显示空状态。 |
onNext | (next) => void | — | 点击“下一个项目”卡片时调用。 |
renderPicture | (which: 'hero' | 'before' | 'after', study) => ReactNode | — | 用你自己的图片(例如截图)代替画出的界面。 |
loading / error / onRetry | boolean / boolean | string / () => void | false | 加载时显示骨架;出错时显示带重试按钮的提示(传字符串可替换说明)。 |
labels | object | — | 替换任意内置文字(键名见 copy.js)。 |
className | string | — | 加在根元素上。 |
装进你的项目
Pro 包含这个区块的完整源码。复制指令,让你的 Agent 把它安装到项目中。
PortfolioCase.jsxportfolio-case.csscopy.jskit.jsxkit.cssui/base-button/ui/empty-state/ui/alert-banner/ui/scroll-reveal/ui/skeleton-shimmer/ui/segmented-control/tokens.cssREADME.md
区块本身、样式和文案、共用的 kit、用到的组件和 tokens.css 会一起装进同一个文件夹。
