Skip to content

Commit b19c8dd

Browse files
committed
style: prettier format
1 parent 9ed7352 commit b19c8dd

File tree

87 files changed

+449
-510
lines changed

Some content is hidden

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

87 files changed

+449
-510
lines changed

antd-tools/getTSCommonConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const fs = require('fs');
44
const assign = require('object-assign');
55
const { getProjectPath } = require('./utils/projectHelper');
66

7-
module.exports = function() {
7+
module.exports = function () {
88
let my = {};
99
if (fs.existsSync(getProjectPath('tsconfig.json'))) {
1010
my = require(getProjectPath('tsconfig.json'));

antd-tools/utils/getChangelog.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
const fs = require('fs');
22

33
module.exports = function getChangelog(file, version) {
4-
const lines = fs
5-
.readFileSync(file)
6-
.toString()
7-
.split('\n');
4+
const lines = fs.readFileSync(file).toString().split('\n');
85
const changeLog = [];
96
const startPattern = new RegExp(`^## ${version}`);
107
const stopPattern = /^## /; // 前一个版本

antd-tools/utils/getRunCmdEnv.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ module.exports = function getRunCmdEnv() {
1111
const nodeModulesBinDir = path.join(__dirname, '../../node_modules/.bin');
1212

1313
Object.entries(env)
14-
.filter(
15-
v =>
16-
v
17-
.slice(0, 1)
18-
.pop()
19-
.toLowerCase() === 'path',
20-
)
14+
.filter(v => v.slice(0, 1).pop().toLowerCase() === 'path')
2115
.forEach(v => {
2216
const key = v.slice(0, 1).pop();
2317
env[key] = env[key] ? `${nodeModulesBinDir}:${env[key]}` : nodeModulesBinDir;

antd-tools/utils/projectHelper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function injectRequire() {
2020
const Module = require('module');
2121

2222
const oriRequire = Module.prototype.require;
23-
Module.prototype.require = function(...args) {
23+
Module.prototype.require = function (...args) {
2424
const moduleName = args[0];
2525
try {
2626
return oriRequire.apply(this, args);

components/affix/index.en-US.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ Please note that Affix should not cover other content on the page, especially wh
3030
**Note:** Children of `Affix` must not have the property `position: absolute`, but you can set `position: absolute` on `Affix` itself:
3131

3232
```html
33-
<a-affix :style="{ position: 'absolute', top: y, left: x}">
34-
...
35-
</a-affix>
33+
<a-affix :style="{ position: 'absolute', top: y, left: x}">...</a-affix>
3634
```
3735

3836
## FAQ

components/affix/index.zh-CN.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ cover: https://gw.alipayobjects.com/zos/alicdn/tX6-md4H6/Affix.svg
2525
### 事件
2626

2727
| 事件名称 | 说明 | 回调参数 | 版本 |
28-
| -------- | ---------------------------- | ----------------- | ---- |
29-
| change | 固定状态改变时触发的回调函数 | Function(affixed) || |
28+
| -------- | ---------------------------- | ----------------- | ---- | --- |
29+
| change | 固定状态改变时触发的回调函数 | Function(affixed) || |
3030

3131
**注意:**`Affix` 内的元素不要使用绝对定位,如需要绝对定位的效果,可以直接设置 `Affix` 为绝对定位:
3232

3333
```html
34-
<a-affix :style="{ position: 'absolute', top: y, left: x}">
35-
...
36-
</a-affix>
34+
<a-affix :style="{ position: 'absolute', top: y, left: x}">...</a-affix>
3735
```
3836

3937
## FAQ

components/anchor/index.en-US.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ For displaying anchor hyperlinks on page and jumping between them.
3232
### Events
3333

3434
| Events Name | Description | Arguments | Version |
35-
| --- | --- | --- | --- |
35+
| --- | --- | --- | --- | --- |
3636
| click | set the handler to handle `click` event | Function(e: Event, link: Object) | |
3737
| change | Listening for anchor link change | (currentActiveLink: string) => void | | 1.5.0 |
3838

components/anchor/index.zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_1-C1JwsC/Anchor.svg
3333
### 事件
3434

3535
| 事件名称 | 说明 | 回调参数 | 版本 |
36-
| -------- | ---------------------- | ----------------------------------- | ---- |
36+
| -------- | ---------------------- | ----------------------------------- | ---- | ----- |
3737
| click | `click` 事件的 handler | Function(e: Event, link: Object) | |
3838
| change | 监听锚点链接改变 | (currentActiveLink: string) => void | | 1.5.0 |
3939

components/badge/index.zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/6%26GF9WHwvY/Badge.svg
4545
| --- | --- | --- | --- | --- |
4646
| color | 自定义缎带的颜色 | string | - | |
4747
| placement | 缎带的位置,`start``end` 随文字方向(RTL 或 LTR)变动 | `start` \| `end` | `end` | |
48-
| text | 缎带中填入的内容 | string \| VNode \| slot | - | |
48+
| text | 缎带中填入的内容 | string \| VNode \| slot | - | |

components/breadcrumb/index.en-US.md

+53-57
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
2424

2525
### Breadcrumb.Item
2626

27-
| Property | Description | Type | Default | Version |
28-
| --- | --- | --- | --- | --- |
29-
| href | Target of hyperlink | string | - | |
30-
| overlay | The dropdown menu | [Menu](/components/menu) \| () => Menu | - | |
27+
| Property | Description | Type | Default | Version |
28+
| -------- | ------------------- | -------------------------------------- | ------- | ------- |
29+
| href | Target of hyperlink | string | - | |
30+
| overlay | The dropdown menu | [Menu](/components/menu) \| () => Menu | - | |
3131

3232
#### Events
3333

34-
| Events Name | Description | Arguments | Version |
35-
| -------- | -------- | -------------------- | ---- |
36-
| click | handler to handle click event | (e:MouseEvent)=>void | - | 1.5.0 |
34+
| Events Name | Description | Arguments | Version |
35+
| ----------- | ----------------------------- | -------------------- | ------- | ----- |
36+
| click | handler to handle click event | (e:MouseEvent)=>void | - | 1.5.0 |
3737

3838
### Breadcrumb.Separator `1.5.0`
3939

40-
| Property | Description | Type | Default | Version |
41-
| -------- | ---------------- | --------- | ------- | ------- |
42-
| - | - | - | - | - |
40+
| Property | Description | Type | Default | Version |
41+
| -------- | ----------- | ---- | ------- | ------- |
42+
| - | - | - | - | - |
4343

4444
> When using `Breadcrumb.Separator`,its parent component must be set to `separator=""`, otherwise the default separator of the parent component will appear.
4545
@@ -64,59 +64,55 @@ The link of Breadcrumb item targets `#` by default, you can use `itemRender` to
6464
<template>
6565
<a-breadcrumb :routes="routes">
6666
<template #itemRender="{ route, params, routes, paths }">
67-
<span v-if="routes.indexOf(route) === routes.length - 1">
68-
{{route.breadcrumbName}}
69-
</span>
70-
<router-link v-else :to="paths.join('/')">
71-
{{route.breadcrumbName}}
72-
</router-link>
67+
<span v-if="routes.indexOf(route) === routes.length - 1">{{route.breadcrumbName}}</span>
68+
<router-link v-else :to="paths.join('/')">{{route.breadcrumbName}}</router-link>
7369
</template>
7470
</a-breadcrumb>
7571
</template>
7672
<script lang="ts">
77-
import { defineComponent, ref } from 'vue';
78-
interface Route {
79-
path: string;
80-
breadcrumbName: string;
81-
children?: Array<{
73+
import { defineComponent, ref } from 'vue';
74+
interface Route {
8275
path: string;
8376
breadcrumbName: string;
84-
}>;
85-
}
86-
export default defineComponent({
87-
setup () {
88-
const routes = ref<Route[]>([
89-
{
90-
path: 'index',
91-
breadcrumbName: 'home',
92-
},
93-
{
94-
path: 'first',
95-
breadcrumbName: 'first',
96-
children: [
97-
{
98-
path: '/general',
99-
breadcrumbName: 'General',
100-
},
101-
{
102-
path: '/layout',
103-
breadcrumbName: 'Layout',
104-
},
105-
{
106-
path: '/navigation',
107-
breadcrumbName: 'Navigation',
108-
},
109-
],
110-
},
111-
{
112-
path: 'second',
113-
breadcrumbName: 'second',
114-
},
115-
]);
116-
return {
117-
routes,
118-
}
77+
children?: Array<{
78+
path: string;
79+
breadcrumbName: string;
80+
}>;
11981
}
120-
});
82+
export default defineComponent({
83+
setup() {
84+
const routes = ref<Route[]>([
85+
{
86+
path: 'index',
87+
breadcrumbName: 'home',
88+
},
89+
{
90+
path: 'first',
91+
breadcrumbName: 'first',
92+
children: [
93+
{
94+
path: '/general',
95+
breadcrumbName: 'General',
96+
},
97+
{
98+
path: '/layout',
99+
breadcrumbName: 'Layout',
100+
},
101+
{
102+
path: '/navigation',
103+
breadcrumbName: 'Navigation',
104+
},
105+
],
106+
},
107+
{
108+
path: 'second',
109+
breadcrumbName: 'second',
110+
},
111+
]);
112+
return {
113+
routes,
114+
};
115+
},
116+
});
121117
</script>
122118
```

components/breadcrumb/index.zh-CN.md

+45-49
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ cover: https://gw.alipayobjects.com/zos/alicdn/9Ltop8JwH/Breadcrumb.svg
3333
#### 事件
3434

3535
| 事件名称 | 说明 | 回调参数 | 版本 |
36-
| -------- | -------- | -------------------- | ---- |
36+
| -------- | -------- | -------------------- | ---- | ----- |
3737
| click | 单击事件 | (e:MouseEvent)=>void | - | 1.5.0 |
3838

3939
### Breadcrumb.Separator `1.5.0`
4040

4141
| 参数 | 类型 | 默认值 | 版本 |
4242
| ---- | ---- | ------ | ---- |
43-
| - | - | - | - |
43+
| - | - | - | - |
4444

4545
> 注意:在使用 `Breadcrumb.Separator` 时,其父组件的分隔符必须设置为 `separator=""`,否则会出现父组件默认的分隔符。
4646
@@ -65,59 +65,55 @@ interface Route {
6565
<template>
6666
<a-breadcrumb :routes="routes">
6767
<template #itemRender="{ route, params, routes, paths }">
68-
<span v-if="routes.indexOf(route) === routes.length - 1">
69-
{{route.breadcrumbName}}
70-
</span>
71-
<router-link v-else :to="paths.join('/')">
72-
{{route.breadcrumbName}}
73-
</router-link>
68+
<span v-if="routes.indexOf(route) === routes.length - 1">{{route.breadcrumbName}}</span>
69+
<router-link v-else :to="paths.join('/')">{{route.breadcrumbName}}</router-link>
7470
</template>
7571
</a-breadcrumb>
7672
</template>
7773
<script lang="ts">
78-
import { defineComponent, ref } from 'vue';
79-
interface Route {
80-
path: string;
81-
breadcrumbName: string;
82-
children?: Array<{
74+
import { defineComponent, ref } from 'vue';
75+
interface Route {
8376
path: string;
8477
breadcrumbName: string;
85-
}>;
86-
}
87-
export default defineComponent({
88-
setup () {
89-
const routes = ref<Route[]>([
90-
{
91-
path: 'index',
92-
breadcrumbName: 'home',
93-
},
94-
{
95-
path: 'first',
96-
breadcrumbName: 'first',
97-
children: [
98-
{
99-
path: '/general',
100-
breadcrumbName: 'General',
101-
},
102-
{
103-
path: '/layout',
104-
breadcrumbName: 'Layout',
105-
},
106-
{
107-
path: '/navigation',
108-
breadcrumbName: 'Navigation',
109-
},
110-
],
111-
},
112-
{
113-
path: 'second',
114-
breadcrumbName: 'second',
115-
},
116-
]);
117-
return {
118-
routes,
119-
}
78+
children?: Array<{
79+
path: string;
80+
breadcrumbName: string;
81+
}>;
12082
}
121-
});
83+
export default defineComponent({
84+
setup() {
85+
const routes = ref<Route[]>([
86+
{
87+
path: 'index',
88+
breadcrumbName: 'home',
89+
},
90+
{
91+
path: 'first',
92+
breadcrumbName: 'first',
93+
children: [
94+
{
95+
path: '/general',
96+
breadcrumbName: 'General',
97+
},
98+
{
99+
path: '/layout',
100+
breadcrumbName: 'Layout',
101+
},
102+
{
103+
path: '/navigation',
104+
breadcrumbName: 'Navigation',
105+
},
106+
],
107+
},
108+
{
109+
path: 'second',
110+
breadcrumbName: 'second',
111+
},
112+
]);
113+
return {
114+
routes,
115+
};
116+
},
117+
});
122118
</script>
123119
```

components/calendar/demo/basic.vue

-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ export default defineComponent({
3636
},
3737
});
3838
</script>
39-

components/calendar/demo/customize-header.vue

-1
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,3 @@ export default defineComponent({
115115
},
116116
});
117117
</script>
118-

components/calendar/demo/notice-calendar.vue

-1
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,3 @@ export default defineComponent({
107107
font-size: 28px;
108108
}
109109
</style>
110-

components/calendar/demo/select.vue

-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ export default defineComponent({
4545
},
4646
});
4747
</script>
48-

components/calendar/index.en-US.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ When data is in the form of dates, such as schedules, timetables, prices calenda
1717

1818
```html
1919
// The default locale is en-US, if you want to use other locale, just set locale in entry file
20-
globally.
21-
// import dayjs from 'dayjs';
22-
// import 'dayjs/locale/zh-cn';
23-
// dayjs.locale('zh-cn');
20+
globally. // import dayjs from 'dayjs'; // import 'dayjs/locale/zh-cn'; // dayjs.locale('zh-cn');
2421

2522
<a-calendar v-model:value @panelChange="onPanelChange" @select="onSelect"></a-calendar>
2623
```

0 commit comments

Comments
 (0)