Skip to content

Commit 648ab4c

Browse files
committed
doc: update
1 parent cb3c002 commit 648ab4c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

components/form/demo/customized-form-controls.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Controls must injects `useInjectFormItemContext` and calls the corresponding met
1919
<template>
2020
<a-form name="customized_form_controls" layout="inline" :model="formState" @finish="onFinish">
2121
<a-form-item name="price" label="Price" :rules="[{ validator: checkPrice }]">
22-
<PriceInput v-model:value="formState.price" />
22+
<price-input v-model:value="formState.price" />
2323
</a-form-item>
2424
<a-form-item>
2525
<a-button type="primary" html-type="submit">Submit</a-button>
@@ -28,6 +28,7 @@ Controls must injects `useInjectFormItemContext` and calls the corresponding met
2828
</template>
2929
<script lang="ts">
3030
import { defineComponent, reactive } from 'vue';
31+
// sorceCode https://github.com/vueComponent/ant-design-vue/blob/cb3c002e17f0f4f5b3e8d01846069da0e2645aff/components/form/demo/price-input.vue
3132
import PriceInput from './price-input.vue';
3233
import type { Currency } from './price-input.vue';
3334

components/form/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ You can reference [Customized Form Controls](#components-form-demo-customized-fo
9494

9595
But it also has some disadvantages:
9696

97-
1. If the custom component wants Form.Item to be verified and displayed, you need to inject `const {id, onFieldChange, onFieldBlur} = useFormItemContext` and call the corresponding method.
97+
1. If the custom component wants Form.Item to be verified and displayed, you need to inject `const {id, onFieldChange, onFieldBlur} = useFormItemContext()` and call the corresponding method.
9898

9999
2. A Form.Item can only collect the data of one form item. If there are multiple form items, it will cause collection confusion, for example,
100100

components/form/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/ORmcdeaoO/Form.svg
9393

9494
但它同样会有一些缺点:
9595

96-
1、自定义组件如果希望 Form.Item 进行校验展示,你需要 `const {id, onFieldChange, onFieldBlur} = useFormItemContext` 注入,并调用相应的方法。
96+
1、自定义组件如果希望 Form.Item 进行校验展示,你需要 `const {id, onFieldChange, onFieldBlur} = useFormItemContext()` 注入,并调用相应的方法。
9797

9898
2、一个 Form.Item 只能收集一个表单项的数据,如果有多个表单项,会导致收集错乱,例如,
9999

0 commit comments

Comments
 (0)