文档目录
IF 红石按钮
IF 红石模式按钮 @ (154,84):IGNORE → NO_REDSTONE → WITH_REDSTONE → ONCE。
import { useState } from "react";
import type { IfRedstoneMode } from "../if-markers";
import { IfRedstoneButton } from "./index";
export function IfRedstoneButtonDemo() {
const [mode, setMode] = useState<IfRedstoneMode>("ignore");
return (
<div className="relative h-32 w-48">
<IfRedstoneButton onClick={() => { setMode("with_redstone"); }} value={mode} />
</div>
);
}
安装
$pnpm add @tennantite/industrialforegoingnpm 方式安装编译产物;需要改造源码请用上方的 CLI 拷贝安装。
源码
packages/industrialforegoing/src/if-redstone-button/index.tsxnpm 包保留源码目录,可直接复制改造。