Skip to content

Commit e86a833

Browse files
committed
doc: update doc, close #5675
1 parent 3ddc7cd commit e86a833

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

CHANGELOG.en-US.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ Github:[https://github.com/surely-vue/table]
564564

565565
You can reference [Customized Form Controls](#components-form-demo-customized-form-controls), but it also has some disadvantages:
566566

567-
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.
567+
1. If the custom component wants Form.Item to be verified and displayed, you need to inject `const {id, onFieldChange, onFieldBlur} = useInjectFormItemContext()` and call the corresponding method.
568568

569569
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,
570570

@@ -586,7 +586,7 @@ Github:[https://github.com/surely-vue/table]
586586
</a-form-item>
587587
```
588588

589-
The second way is to wrap it with a custom component and call `useFormItemContext` in the custom component, It is equivalent to merging multiple form items into one.
589+
The second way is to wrap it with a custom component and call `useInjectFormItemContext` in the custom component, It is equivalent to merging multiple form items into one.
590590

591591
```html
592592
<script>
@@ -595,7 +595,7 @@ Github:[https://github.com/surely-vue/table]
595595
export default {
596596
name: 'custom-name',
597597
setup() {
598-
const formItemContext = Form.useFormItemContext();
598+
const formItemContext = Form.useInjectFormItemContext();
599599
},
600600
};
601601
</script>

CHANGELOG.zh-CN.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ Github:[https://github.com/surely-vue/table]
561561

562562
- 自 3.0 版本以后,Form.Item 不再劫持子元素,而是通过 provider / inject 依赖注入的方式进行自动校验,这种方式可以提高组件性能,子元素也不会限制个数,同样子元素也可以是进一步封装的高级组件。你可以参考[自定义表单控件示例](#components-form-demo-customized-form-controls),但它同样会有一些缺点:
563563

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

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

@@ -583,15 +583,15 @@ Github:[https://github.com/surely-vue/table]
583583
</a-form-item>
584584
```
585585

586-
第二种,使用自定义组件包裹,并在自定义组件中调用 `useFormItemContext`,相当于把多个表单项合并成了一个。
586+
第二种,使用自定义组件包裹,并在自定义组件中调用 `useInjectFormItemContext`,相当于把多个表单项合并成了一个。
587587

588588
```html
589589
<script>
590590
// 自定义组件
591591
import { Form } from 'ant-design-vue';
592592
export default {
593593
setup() {
594-
const formItemContext = Form.useFormItemContext();
594+
const formItemContext = Form.useInjectFormItemContext();
595595
},
596596
};
597597
</script>

site/src/vueDocs/migration-v3.en-US.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The 2.x version is a compatible version developed for compatibility with Vue 3.
2828
- Deprecated `replaceFields`, use `fieldNames` instead.
2929
- `Table`
3030
- Removed the `rowSelection.hideDefaultSelections` property of Table, please use `SELECTION_ALL` and `SELECTION_INVERT` in `rowSelection.selections` instead, [custom options](/components/table/#components-table-demo- row-selection-custom).
31-
- Removed Column slots and replaced them with `v-slot:headerCell` `v-slot:headerCell` `v-slot:bodyCell` `v-slot:customFilterDropdown` `v-slot:customFilterIcon`.
31+
- Removed Column slots and replaced them with `v-slot:headerCell` `v-slot:bodyCell` `v-slot:customFilterDropdown` `v-slot:customFilterIcon`.
3232

3333
#### Component refactoring
3434

@@ -49,7 +49,7 @@ Major updates after the 3.0 version refactoring include `Tree` `TreeSelect` `Dat
4949
- `Table`
5050

5151
- Removed the `rowSelection.hideDefaultSelections` property of Table, please use `SELECTION_ALL` and `SELECTION_INVERT` in `rowSelection.selections` instead, [custom options](/components/table/#components-table-demo- row-selection-custom).
52-
- Removed Column slots and replaced them with `v-slot:headerCell` `v-slot:headerCell` `v-slot:bodyCell` `v-slot:customFilterDropdown` `v-slot:customFilterIcon` to improve ease of use , To avoid slot configuration expansion, but also to avoid the problem of slot conflicts.
52+
- Removed Column slots and replaced them with `v-slot:headerCell` `v-slot:bodyCell` `v-slot:customFilterDropdown` `v-slot:customFilterIcon` to improve ease of use , To avoid slot configuration expansion, but also to avoid the problem of slot conflicts.
5353
- Added expandFixed to control whether the expanded icon is fixed.
5454
- Added the showSorterTooltip header whether to display the tooltip for the next sort.
5555
- Added sticky for setting sticky head and scroll bar.
@@ -72,7 +72,7 @@ Major updates after the 3.0 version refactoring include `Tree` `TreeSelect` `Dat
7272

7373
You can reference [Customized Form Controls](#components-form-demo-customized-form-controls), but it also has some disadvantages:
7474

75-
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.
75+
1. If the custom component wants Form.Item to be verified and displayed, you need to inject `const {id, onFieldChange, onFieldBlur} = useInjectFormItemContext()` and call the corresponding method.
7676

7777
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:
7878

@@ -94,7 +94,7 @@ Major updates after the 3.0 version refactoring include `Tree` `TreeSelect` `Dat
9494
</a-form-item>
9595
```
9696

97-
The second way is to wrap it with a custom component and call `useFormItemContext` in the custom component, It is equivalent to merging multiple form items into one.
97+
The second way is to wrap it with a custom component and call `useInjectFormItemContext` in the custom component, It is equivalent to merging multiple form items into one.
9898

9999
```html
100100
<script>
@@ -103,7 +103,7 @@ Major updates after the 3.0 version refactoring include `Tree` `TreeSelect` `Dat
103103
export default {
104104
name: 'custom-name',
105105
setup() {
106-
const formItemContext = Form.useFormItemContext();
106+
const formItemContext = Form.useInjectFormItemContext();
107107
},
108108
};
109109
</script>

site/src/vueDocs/migration-v3.zh-CN.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
- 废弃 `replaceFields` , 使用 `fieldNames` 替换。
3030
- `Table`
3131
- 移除了 Table 的 `rowSelection.hideDefaultSelections` 属性,请在 `rowSelection.selections` 中使用 `SELECTION_ALL``SELECTION_INVERT` 替代,[自定义选择项](/components/table/#components-table-demo-row-selection-custom)
32-
- 移除了 Column slots,分别使用 `v-slot:headerCell` `v-slot:headerCell` `v-slot:bodyCell` `v-slot:customFilterDropdown` `v-slot:customFilterIcon` 替换。
32+
- 移除了 Column slots,分别使用 `v-slot:headerCell` `v-slot:bodyCell` `v-slot:customFilterDropdown` `v-slot:customFilterIcon` 替换。
3333

3434
#### 组件重构
3535

@@ -50,7 +50,7 @@
5050
- `Table`
5151

5252
- 移除了 Table 的 `rowSelection.hideDefaultSelections` 属性,请在 `rowSelection.selections` 中使用 `SELECTION_ALL``SELECTION_INVERT` 替代,[自定义选择项](/components/table/#components-table-demo-row-selection-custom)
53-
- 移除了 Column slots,分别使用 `v-slot:headerCell` `v-slot:headerCell` `v-slot:bodyCell` `v-slot:customFilterDropdown` `v-slot:customFilterIcon` 替换,提升易用性,避免插槽配置膨胀,同时也避免了插槽冲突问题。
53+
- 移除了 Column slots,分别使用 `v-slot:headerCell` `v-slot:bodyCell` `v-slot:customFilterDropdown` `v-slot:customFilterIcon` 替换,提升易用性,避免插槽配置膨胀,同时也避免了插槽冲突问题。
5454
- 新增 expandFixed 控制展开图标是否固定。
5555
- 新增 showSorterTooltip 表头是否显示下一次排序的 tooltip 提示。
5656
- 新增 sticky 用于设置粘性头部和滚动条。
@@ -71,7 +71,7 @@
7171

7272
- 自 3.0 版本以后,Form.Item 不再劫持子元素,而是通过 provider / inject 依赖注入的方式进行自动校验,这种方式可以提高组件性能,子元素也不会限制个数,同样子元素也可以是进一步封装的高级组件。你可以参考[自定义表单控件示例](#components-form-demo-customized-form-controls),但它同样会有一些缺点:
7373

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

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

@@ -93,15 +93,15 @@
9393
</a-form-item>
9494
```
9595

96-
第二种,使用自定义组件包裹,并在自定义组件中调用 `useFormItemContext`,相当于把多个表单项合并成了一个。
96+
第二种,使用自定义组件包裹,并在自定义组件中调用 `useInjectFormItemContext`,相当于把多个表单项合并成了一个。
9797

9898
```html
9999
<script>
100100
// 自定义组件
101101
import { Form } from 'ant-design-vue';
102102
export default {
103103
setup() {
104-
const formItemContext = Form.useFormItemContext();
104+
const formItemContext = Form.useInjectFormItemContext();
105105
},
106106
};
107107
</script>

0 commit comments

Comments
 (0)