文档目录
村民交易界面
276×166 面板 + 98×116 交易列表 + 价签槽。
交易
农民 - 新手
物品栏
64
import { TradingScreen } from "./index";
/**
* TradingScreen 预览用例(规格 §6.2)
*/
export function TradingScreenDemo() {
return (
<TradingScreen
hotbarItems={[{ count: 64, icon: "dirt-block" }]}
title="农民 - 新手"
trades={[
{
inputA: { count: 20, icon: "wheat", tooltip: "小麦 ×20" },
output: { icon: "emerald", tooltip: "绿宝石" },
},
{
inputA: { count: 1, icon: "emerald", tooltip: "绿宝石" },
output: { count: 6, icon: "bread", tooltip: "面包 ×6" },
},
]}
/>
);
}
安装
CLI 拷贝
$npx shadcn add @tennantite/trading-screennpm 直装
$pnpm add @tennantite/uinpm 方式安装编译产物;需要改造源码请用上方的 CLI 拷贝安装。
源码
packages/ui/src/screens/containers/trading-screen/index.tsxnpm 包保留源码目录,可直接复制改造。