whistle.mock-plugins 1.2.2-beta.12 → 1.2.2-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whistle.mock-plugins",
3
- "version": "1.2.2-beta.12",
3
+ "version": "1.2.2-beta.13",
4
4
  "description": "Whistle 插件,用于快速创建 API 模拟数据",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -53,6 +53,9 @@ const COLUMN_CONFIG = [
53
53
  { key: 'action', title: '操作', required: true }
54
54
  ];
55
55
 
56
+ // 透传字段组件:不渲染任何 UI,仅让 Form 能存储任意类型的值(数组/对象)
57
+ const PassthroughField = ({ value, onChange }) => null;
58
+
56
59
  const InterfaceManagement = () => {
57
60
  const { featureId } = useParams();
58
61
  const history = useHistory();
@@ -1779,16 +1782,12 @@ const InterfaceManagement = () => {
1779
1782
  <Input />
1780
1783
  </Form.Item>
1781
1784
 
1782
- {/* 隐藏的表单字段用于存储响应数据 */}
1783
- <Form.Item
1784
- name="responses"
1785
- initialValue={[]}
1786
- hidden
1787
- >
1788
- <Input />
1785
+ {/* 隐藏的表单字段用于存储响应数据(透传任意值,不渲染UI) */}
1786
+ <Form.Item name="responses" initialValue={[]} noStyle>
1787
+ <PassthroughField />
1789
1788
  </Form.Item>
1790
- <Form.Item name="activeResponseId" hidden>
1791
- <Input />
1789
+ <Form.Item name="activeResponseId" noStyle>
1790
+ <PassthroughField />
1792
1791
  </Form.Item>
1793
1792
 
1794
1793
  {/* 使用新的合并组件 */}