From 879872ac238682ceb01f2fc5c0a261fc10572bb6 Mon Sep 17 00:00:00 2001 From: shu Date: Sun, 6 Sep 2026 19:08:03 +0800 Subject: 限制表单示例页面最大宽度并居中展示 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用 Mantine Container 包裹表单示例页面,设置 size="xl" - 设置 px={0},复用基础布局已有的内边距,避免重复留白 - 保留小屏幕自适应宽度,并同步调整 JSX 缩进 验证:pnpm build、pnpm lint 和 git diff --check 均通过。 --- src/FormExample.tsx | 337 ++++++++++++++++++++++++++-------------------------- 1 file changed, 170 insertions(+), 167 deletions(-) (limited to 'src/FormExample.tsx') diff --git a/src/FormExample.tsx b/src/FormExample.tsx index 7f38754..631bf53 100644 --- a/src/FormExample.tsx +++ b/src/FormExample.tsx @@ -6,6 +6,7 @@ import { Cascader, Code, ColorInput, + Container, FileInput, Group, MultiSelect, @@ -123,184 +124,186 @@ export default function FormExample() { } return ( - -
- 表单示例 - 体验常用表单控件。提交后在本页预览结果,数据和文件不会发送到服务器。 -
+ + +
+ 表单示例 + 体验常用表单控件。提交后在本页预览结果,数据和文件不会发送到服务器。 +
- -
setSubmitted(null))} - onReset={(event) => { - event.preventDefault() - form.reset() - form.setErrors(exampleErrors) - setSubmitted(null) - }} - noValidate - > - - 带 * 的项目为必填项;离开输入框或提交时会校验。邮箱预填了错误值,用于演示错误提示。 - - - - + + + + + - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - 0 && ( + + {form.values.files.map((file, index) => ( + + {file.name} · {(file.size / 1024).toFixed(1)} KB + + ))} + + )} + +