Skip to content

Commit 5376014

Browse files
committed
docs: update doc anchor
1 parent bccd920 commit 5376014

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+163
-329
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ English | [简体中文](./README-zh_CN.md)
2828

2929
## Environment Support
3030

31-
- Modern browsers. v1.x support Internet Explorer 9+ (with [polyfills](https://www.antdv.com/docs/vue/getting-started/#Compatibility))
31+
- Modern browsers. v1.x support Internet Explorer 9+ (with [polyfills](https://www.antdv.com/docs/vue/getting-started/#compatibility))
3232
- Server-side Rendering
3333
- Support Vue 2 & Vue 3
3434
- [Electron](https://electronjs.org/)

components/anchor/__tests__/Anchor.test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ describe('Anchor Render', () => {
4848
currentActiveLink.value = current;
4949
}}
5050
>
51-
<Link href="http://www.example.com/#API" title="API" />
51+
<Link href="http://www.example.com/#api" title="API" />
5252
</Anchor>
5353
);
5454
},
5555
},
5656
{ sync: false },
5757
);
5858
await sleep();
59-
wrapper.find('a[href="http://www.example.com/#API"]').trigger('click');
60-
expect(currentActiveLink.value).toBe('http://www.example.com/#API');
59+
wrapper.find('a[href="http://www.example.com/#api"]').trigger('click');
60+
expect(currentActiveLink.value).toBe('http://www.example.com/#api');
6161
});
6262
/*
6363
it('Anchor render perfectly for complete href - scroll', done => {
@@ -68,7 +68,7 @@ describe('Anchor Render', () => {
6868
<div>
6969
<div id="API">Hello</div>
7070
<Anchor ref="anchor">
71-
<Link href="http://www.example.com/#API" title="API" />
71+
<Link href="http://www.example.com/#api" title="API" />
7272
</Anchor>
7373
</div>
7474
);
@@ -78,7 +78,7 @@ describe('Anchor Render', () => {
7878
);
7979
wrapper.vm.$nextTick(() => {
8080
wrapper.vm.$refs.anchor.handleScroll();
81-
expect(wrapper.vm.$refs.anchor.$data.activeLink).toBe('http://www.example.com/#API');
81+
expect(wrapper.vm.$refs.anchor.$data.activeLink).toBe('http://www.example.com/#api');
8282
done();
8383
});
8484
});
@@ -92,7 +92,7 @@ describe('Anchor Render', () => {
9292
<div>
9393
<div id="API">Hello</div>
9494
<Anchor ref="anchor">
95-
<Link href="##API" title="API" />
95+
<Link href="##api" title="API" />
9696
</Anchor>
9797
</div>
9898
);
@@ -101,8 +101,8 @@ describe('Anchor Render', () => {
101101
{ sync: false, attachTo: 'body' },
102102
);
103103
await asyncExpect(() => {
104-
wrapper.vm.$refs.anchor.handleScrollTo('##API');
105-
expect(wrapper.vm.$refs.anchor.$data.activeLink).toBe('##API');
104+
wrapper.vm.$refs.anchor.handleScrollTo('##api');
105+
expect(wrapper.vm.$refs.anchor.$data.activeLink).toBe('##api');
106106
expect(scrollToSpy).not.toHaveBeenCalled();
107107
});
108108
await asyncExpect(() => {
@@ -116,7 +116,7 @@ describe('Anchor Render', () => {
116116
render() {
117117
return (
118118
<Anchor ref="anchor">
119-
<Link href="#API" title="API" />
119+
<Link href="#api" title="API" />
120120
</Anchor>
121121
);
122122
},
@@ -141,14 +141,14 @@ describe('Anchor Render', () => {
141141
},
142142
render() {
143143
return (
144-
<Anchor ref="anchor">{this.showLink ? <Link href="#API" title="API" /> : null}</Anchor>
144+
<Anchor ref="anchor">{this.showLink ? <Link href="#api" title="API" /> : null}</Anchor>
145145
);
146146
},
147147
},
148148
{ sync: false, attachTo: 'body' },
149149
);
150150
await asyncExpect(() => {
151-
expect(wrapper.vm.$refs.anchor.links).toEqual(['#API']);
151+
expect(wrapper.vm.$refs.anchor.links).toEqual(['#api']);
152152
wrapper.setProps({ showLink: false });
153153
});
154154
await asyncExpect(() => {
@@ -172,12 +172,12 @@ describe('Anchor Render', () => {
172172
sync: false,
173173
attachTo: 'body',
174174
props: {
175-
href: '#API',
175+
href: '#api',
176176
},
177177
},
178178
);
179179
await asyncExpect(() => {
180-
expect(wrapper.vm.$refs.anchor.links).toEqual(['#API']);
180+
expect(wrapper.vm.$refs.anchor.links).toEqual(['#api']);
181181
wrapper.setProps({ href: '#API_1' });
182182
});
183183
await asyncExpect(() => {
@@ -190,7 +190,7 @@ describe('Anchor Render', () => {
190190
let link;
191191
const handleClick = (...arg) => ([event, link] = arg);
192192
193-
const href = '#API';
193+
const href = '#api';
194194
const title = 'API';
195195
196196
const anchorRef = Vue.ref(null);

components/anchor/__tests__/__snapshots__/demo.test.js.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exports[`renders ./components/anchor/demo/customizeHighlight.vue correctly 1`] =
3030
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#components-anchor-demo-static" title="Static demo">Static demo</a>
3131
<!---->
3232
</div>
33-
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#API" title="API">API</a>
33+
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#api" title="API">API</a>
3434
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#Anchor-Props" title="Anchor Props">Anchor Props</a>
3535
<!---->
3636
</div>
@@ -83,7 +83,7 @@ exports[`renders ./components/anchor/demo/onChange.vue correctly 1`] = `
8383
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#components-anchor-demo-static" title="Static demo">Static demo</a>
8484
<!---->
8585
</div>
86-
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#API" title="API">API</a>
86+
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#api" title="API">API</a>
8787
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#Anchor-Props" title="Anchor Props">Anchor Props</a>
8888
<!---->
8989
</div>
@@ -104,7 +104,7 @@ exports[`renders ./components/anchor/demo/onClick.vue correctly 1`] = `
104104
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#components-anchor-demo-static" title="Static demo">Static demo</a>
105105
<!---->
106106
</div>
107-
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#API" title="API">API</a>
107+
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#api" title="API">API</a>
108108
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#Anchor-Props" title="Anchor Props">Anchor Props</a>
109109
<!---->
110110
</div>
@@ -125,7 +125,7 @@ exports[`renders ./components/anchor/demo/static.vue correctly 1`] = `
125125
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#components-anchor-demo-static" title="Static demo">Static demo</a>
126126
<!---->
127127
</div>
128-
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#API" title="API">API</a>
128+
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#api" title="API">API</a>
129129
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#Anchor-Props" title="Anchor Props">Anchor Props</a>
130130
<!---->
131131
</div>
@@ -149,7 +149,7 @@ exports[`renders ./components/anchor/demo/targetOffset.vue correctly 1`] = `
149149
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#components-anchor-demo-static" title="Static demo">Static demo</a>
150150
<!---->
151151
</div>
152-
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#API" title="API">API</a>
152+
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#api" title="API">API</a>
153153
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#Anchor-Props" title="Anchor Props">Anchor Props</a>
154154
<!---->
155155
</div>

components/anchor/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For displaying anchor hyperlinks on page and jumping between them.
2626
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - | |
2727
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 | |
2828
| showInkInFixed | Whether show ink-square when `:affix="false"` | boolean | false | |
29-
| targetOffset | Anchor scroll offset, default as `offsetTop`, [example](#components-anchor-demo-targetOffset) | number | `offsetTop` | 1.5.0 |
29+
| targetOffset | Anchor scroll offset, default as `offsetTop`, [example](#components-anchor-demo-targetoffset) | number | `offsetTop` | 1.5.0 |
3030
| wrapperClass | The class name of the container | string | - | |
3131
| wrapperStyle | The style of the container | object | - | |
3232
| items | Data configuration option content, support nesting through children | { key, href, title, target, children }\[] [see](#anchoritem) | - | 4.0 |

components/anchor/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*JGb3RIzyOCkAAA
2727
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | | |
2828
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | | |
2929
| showInkInFixed | `:affix="false"` 时是否显示小方块 | boolean | false | |
30-
| targetOffset | 锚点滚动偏移量,默认与 offsetTop 相同,[例子](#components-anchor-demo-targetOffset) | number | `offsetTop` | 1.5.0 |
30+
| targetOffset | 锚点滚动偏移量,默认与 offsetTop 相同,[例子](#components-anchor-demo-targetoffset) | number | `offsetTop` | 1.5.0 |
3131
| wrapperClass | 容器的类名 | string | - | |
3232
| wrapperStyle | 容器样式 | object | - | |
3333
| items | 数据化配置选项内容,支持通过 children 嵌套 | { key, href, title, target, children }\[] [具体见](#anchoritem) | - | 4.0 |

components/button/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ It accepts all props which native buttons support.
5858

5959
### How to remove space between 2 chinese characters
6060

61-
Following the Ant Design specification, we will add one space between if Button (exclude Text button and Link button) contains two Chinese characters only. If you don't need that, you can use [ConfigProvider](/components/config-provider/#API) to set `autoInsertSpaceInButton` as `false`.
61+
Following the Ant Design specification, we will add one space between if Button (exclude Text button and Link button) contains two Chinese characters only. If you don't need that, you can use [ConfigProvider](/components/config-provider/#api) to set `autoInsertSpaceInButton` as `false`.
6262

6363
<img src="https://gw.alipayobjects.com/zos/antfincdn/MY%26THAPZrW/38f06cb9-293a-4b42-b183-9f443e79ffea.png" style="box-shadow: none; margin: 0; width: 100px" alt="Button with two Chinese characters" />

components/button/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*Lp1kTYmSsgoAAA
6161

6262
### 如何移除 2 个汉字之间的空格
6363

64-
根据 Ant Design 设计规范要求,我们会在按钮内(文本按钮和链接按钮除外)只有两个汉字时自动添加空格,如果你不需要这个特性,可以设置 [ConfigProvider](/components/config-provider/#API)`autoInsertSpaceInButton``false`
64+
根据 Ant Design 设计规范要求,我们会在按钮内(文本按钮和链接按钮除外)只有两个汉字时自动添加空格,如果你不需要这个特性,可以设置 [ConfigProvider](/components/config-provider/#api)`autoInsertSpaceInButton``false`
6565

6666
<img src="https://gw.alipayobjects.com/zos/antfincdn/MY%26THAPZrW/38f06cb9-293a-4b42-b183-9f443e79ffea.png" style="box-shadow: none; margin: 0; width: 100px" alt="移除两个汉字之间的空格" />

components/config-provider/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Some components use dynamic style to support wave effect. You can config `csp` p
5353
| csp | Set [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) config | { nonce: string } | - | |
5454
| direction | Set direction of layout. See [demo](#components-config-provider-demo-direction) | `ltr` \| `rtl` | `ltr` | 3.0 |
5555
| dropdownMatchSelectWidth | Determine whether the dropdown menu and the select input are the same width. Default set `min-width` same as input. Will ignore when value less than select width. `false` will disable virtual scroll | boolean \| number | - | 3.0 |
56-
| form | Set Form common props | { validateMessages?: [ValidateMessages](/components/form/#validateMessages), requiredMark?: boolean \| `optional` } | - | 3.0 |
56+
| form | Set Form common props | { validateMessages?: [ValidateMessages](/components/form/#validatemessages), requiredMark?: boolean \| `optional` } | - | 3.0 |
5757
| getPopupContainer | to set the container of the popup element. The default is to create a `div` element in `body`. | Function(triggerNode, dialogContext) | `() => document.body` | |
5858
| getTargetContainer | Config Affix, Anchor scroll target container | () => HTMLElement | () => window | 3.0 |
5959
| input | Set Input common props | { autocomplete?: string } | - | 3.0 |

components/config-provider/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ ConfigProvider 使用 Vue 的 [provide / inject](https://vuejs.org/v2/api/#provi
5454
| csp | 设置 [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) 配置 | { nonce: string } | - | |
5555
| direction | 设置文本展示方向。 [示例](#components-config-provider-demo-direction) | `ltr` \| `rtl` | `ltr` | 3.0 |
5656
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽。默认将设置 `min-width`,当值小于选择框宽度时会被忽略。`false` 时会关闭虚拟滚动 | boolean \| number | - | |
57-
| form | 设置 Form 组件的通用属性 | { validateMessages?: [ValidateMessages](/components/form/#validateMessages), requiredMark?: boolean \| `optional`, colon?: boolean} | - | 3.0 |
57+
| form | 设置 Form 组件的通用属性 | { validateMessages?: [ValidateMessages](/components/form/#validatemessages), requiredMark?: boolean \| `optional`, colon?: boolean} | - | 3.0 |
5858
| getPopupContainer | 弹出框(Select, Tooltip, Menu 等等)渲染父节点,默认渲染到 body 上。 | Function(triggerNode, dialogContext) | () => document.body | |
5959
| getTargetContainer | 配置 Affix、Anchor 滚动监听容器。 | () => HTMLElement | () => window | 3.0 |
6060
| input | 设置 Input 组件的通用属性 | { autocomplete?: string } | - | 3.0 |

components/date-picker/index.en-US.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ The following APIs are shared by DatePicker, RangePicker.
8484
| dateRender | Custom rendering function for date cells | v-slot:dateRender="{current, today}" | - | |
8585
| disabled | Determine whether the DatePicker is disabled | boolean | false | |
8686
| disabledDate | Specify the date that cannot be selected | (currentDate: dayjs) => boolean | - | |
87-
| format | To set the date format, refer to [dayjs](https://day.js.org/). When an array is provided, all values are used for parsing and first value is used for formatting, support [Custom Format](#components-date-picker-demo-format) | [formatType](#formatType) | `YYYY-MM-DD` | |
87+
| format | To set the date format, refer to [dayjs](https://day.js.org/). When an array is provided, all values are used for parsing and first value is used for formatting, support [Custom Format](#components-date-picker-demo-format) | [formatType](#formattype) | `YYYY-MM-DD` | |
8888
| dropdownClassName | To customize the className of the popup calendar | string | - | |
8989
| getPopupContainer | To set the container of the floating layer, while the default is to create a `div` element in `body` | function(trigger) | - | |
9090
| inputReadOnly | Set the `readonly` attribute of the input tag (avoids virtual keyboard on touch devices) | boolean | false | |
@@ -125,10 +125,10 @@ The following APIs are shared by DatePicker, RangePicker.
125125
| --- | --- | --- | --- | --- |
126126
| defaultPickerValue | To set default picker date | [dayjs](https://day.js.org/) | - | |
127127
| disabledTime | To specify the time that cannot be selected | function(date) | - | |
128-
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formatType) | `YYYY-MM-DD` | |
128+
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formattype) | `YYYY-MM-DD` | |
129129
| renderExtraFooter | Render extra footer in panel | v-slot:renderExtraFooter="mode" | - | |
130130
| showNow | Whether to show 'Now' button on panel when `showTime` is set | boolean | - | |
131-
| showTime | To provide an additional time selection | object \| boolean | [TimePicker Options](/components/time-picker/#API) | |
131+
| showTime | To provide an additional time selection | object \| boolean | [TimePicker Options](/components/time-picker/#api) | |
132132
| showTime.defaultValue | To set default time of selected date, [demo](#components-date-picker-demo-disabled-date) | [dayjs](https://day.js.org/) | dayjs() | |
133133
| showToday | Whether to show `Today` button | boolean | true | |
134134
| value(v-model) | To set date | [dayjs](https://day.js.org/) | - | |
@@ -144,26 +144,26 @@ The following APIs are shared by DatePicker, RangePicker.
144144

145145
| Property | Description | Type | Default | Version |
146146
| --- | --- | --- | --- | --- |
147-
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formatType) | `YYYY` | |
147+
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formattype) | `YYYY` | |
148148

149149
### DatePicker\[picker=quarter]
150150

151151
| Property | Description | Type | Default | Version |
152152
| --- | --- | --- | --- | --- |
153-
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formatType) | `YYYY-\QQ` | |
153+
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formattype) | `YYYY-\QQ` | |
154154

155155
### DatePicker\[picker=month]
156156

157157
| Property | Description | Type | Default | Version |
158158
| --- | --- | --- | --- | --- |
159-
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formatType) | `YYYY-MM` | |
159+
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formattype) | `YYYY-MM` | |
160160
| monthCellRender | Custom month cell content render method | v-slot:monthCellRender="{current, locale}" | - | |
161161

162162
### DatePicker\[picker=week]
163163

164164
| Property | Description | Type | Default | Version |
165165
| --- | --- | --- | --- | --- |
166-
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formatType) | `YYYY-wo` | |
166+
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formattype) | `YYYY-wo` | |
167167

168168
### RangePicker
169169

@@ -174,12 +174,12 @@ The following APIs are shared by DatePicker, RangePicker.
174174
| defaultPickerValue | To set default picker date | \[[dayjs](https://day.js.org/), [dayjs](https://day.js.org/)] | - | |
175175
| disabled | If disable start or end | \[boolean, boolean] | - | |
176176
| disabledTime | To specify the time that cannot be selected | function(date: dayjs, partial: `start` \| `end`) | - | |
177-
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formatType) | `YYYY-MM-DD HH:mm:ss` | |
177+
| format | To set the date format, refer to [dayjs](https://day.js.org/) | [formatType](#formattype) | `YYYY-MM-DD HH:mm:ss` | |
178178
| presets | The preset ranges for quick selection | { label: slot, value: [dayjs](https://day.js.org/)\[] }[] | - | 4.0 |
179179
| ranges | The preseted ranges for quick selection | { \[range: string]: [dayjs](https://day.js.org/)\[] } \| { \[range: string]: () => [dayjs](https://day.js.org/)\[] } | - | |
180180
| renderExtraFooter | Render extra footer in panel | v-slot:renderExtraFooter="mode" | - | |
181181
| separator | Set separator between inputs | string \| v-slot:separator | `<SwapRightOutlined />` | |
182-
| showTime | To provide an additional time selection | object \| boolean | [TimePicker Options](/components/time-picker/#API) | |
182+
| showTime | To provide an additional time selection | object \| boolean | [TimePicker Options](/components/time-picker/#api) | |
183183
| showTime.defaultValue | To set default time of selected date, [demo](#components-date-picker-demo-disabled-date) | [dayjs](https://day.js.org/)\[] | \[dayjs(), dayjs()] | |
184184
| value(v-model) | To set date | \[[dayjs](https://day.js.org/), [dayjs](https://day.js.org/)] | - | |
185185

0 commit comments

Comments
 (0)