From b19c8dd650b9613c901daf304a156e7d6e921b85 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sun, 5 Dec 2021 01:06:31 +0800 Subject: [PATCH] style: prettier format --- antd-tools/getTSCommonConfig.js | 2 +- antd-tools/utils/getChangelog.js | 5 +- antd-tools/utils/getRunCmdEnv.js | 8 +- antd-tools/utils/projectHelper.js | 2 +- components/affix/index.en-US.md | 4 +- components/affix/index.zh-CN.md | 8 +- components/anchor/index.en-US.md | 2 +- components/anchor/index.zh-CN.md | 2 +- components/badge/index.zh-CN.md | 2 +- components/breadcrumb/index.en-US.md | 110 +++++++++--------- components/breadcrumb/index.zh-CN.md | 94 +++++++-------- components/calendar/demo/basic.vue | 1 - components/calendar/demo/customize-header.vue | 1 - components/calendar/demo/notice-calendar.vue | 1 - components/calendar/demo/select.vue | 1 - components/calendar/index.en-US.md | 5 +- components/calendar/index.zh-CN.md | 8 +- components/carousel/index.zh-CN.md | 3 +- components/checkbox/index.en-US.md | 14 +-- components/checkbox/index.zh-CN.md | 14 +-- components/collapse/index.zh-CN.md | 16 +-- components/date-picker/demo/basic.vue | 8 +- components/date-picker/demo/bordered.vue | 10 +- components/date-picker/demo/disabled-date.vue | 11 +- components/date-picker/demo/disabled.vue | 5 +- components/date-picker/demo/index.vue | 4 +- components/date-picker/demo/range-picker.vue | 6 +- .../date-picker/demo/select-in-range.vue | 1 - components/date-picker/demo/suffix.vue | 4 +- components/empty/index.zh-CN.md | 10 +- components/grid/index.zh-CN.md | 30 ++--- components/list/index.en-US.md | 26 ++--- components/list/index.zh-CN.md | 24 ++-- components/menu/index.zh-CN.md | 14 +-- components/message/index.zh-CN.md | 14 +-- components/notification/index.en-US.md | 7 +- components/notification/index.zh-CN.md | 1 + components/pagination/index.en-US.md | 2 +- components/pagination/index.zh-CN.md | 2 +- components/popconfirm/index.en-US.md | 4 +- components/popconfirm/index.zh-CN.md | 5 +- components/progress/demo/circle-dynamic.vue | 2 +- components/progress/demo/dynamic.vue | 2 +- components/progress/demo/segment.vue | 6 +- components/result/index.en-US.md | 14 +-- components/result/index.zh-CN.md | 14 +-- components/select/demo/coordinate.vue | 6 +- components/select/demo/hide-selected.vue | 3 +- components/select/demo/multiple.vue | 3 +- components/select/demo/search-box.vue | 3 +- components/select/demo/tags.vue | 3 +- components/skeleton/index.en-US.md | 6 +- components/skeleton/index.zh-CN.md | 6 +- components/slider/index.en-US.md | 2 +- components/slider/index.zh-CN.md | 2 +- components/statistic/index.en-US.md | 14 +-- components/statistic/index.zh-CN.md | 16 +-- components/steps/index.en-US.md | 2 +- components/steps/index.zh-CN.md | 2 +- components/style/mixins/clearfix.less | 1 - components/switch/demo/text.vue | 1 - components/switch/index.en-US.md | 20 ++-- components/time-picker/demo/12hours.vue | 1 - components/time-picker/demo/addon.vue | 2 - components/time-picker/demo/disabled.vue | 1 - components/time-picker/demo/hide-column.vue | 1 - components/time-picker/demo/index.vue | 4 +- components/time-picker/index.en-US.md | 9 +- components/time-picker/index.zh-CN.md | 17 ++- components/timeline/index.zh-CN.md | 12 +- components/tooltip/index.en-US.md | 100 ++++++++-------- components/tooltip/index.zh-CN.md | 102 ++++++++-------- components/tree/demo/directory.vue | 3 +- components/upload/index.en-US.md | 4 +- components/upload/index.zh-CN.md | 4 +- components/vc-cascader/Cascader.jsx | 2 +- package.json | 2 +- site/src/directives/clipboard/delegate.js | 2 +- site/src/directives/clipboard/listen.js | 4 +- site/src/directives/clipboard/tiny-emitter.js | 8 +- site/src/vueDocs/customize-theme.zh-CN.md | 1 + site/src/vueDocs/introduce.en-US.md | 18 +-- site/src/vueDocs/introduce.zh-CN.md | 16 +-- site/src/vueDocs/migration-v2.en-US.md | 3 +- site/src/vueDocs/migration-v2.zh-CN.md | 2 +- site/src/vueDocs/replace-date.en-US.md | 11 +- site/src/vueDocs/replace-date.zh-CN.md | 11 +- 87 files changed, 449 insertions(+), 510 deletions(-) diff --git a/antd-tools/getTSCommonConfig.js b/antd-tools/getTSCommonConfig.js index f47249d89..d935888c4 100644 --- a/antd-tools/getTSCommonConfig.js +++ b/antd-tools/getTSCommonConfig.js @@ -4,7 +4,7 @@ const fs = require('fs'); const assign = require('object-assign'); const { getProjectPath } = require('./utils/projectHelper'); -module.exports = function() { +module.exports = function () { let my = {}; if (fs.existsSync(getProjectPath('tsconfig.json'))) { my = require(getProjectPath('tsconfig.json')); diff --git a/antd-tools/utils/getChangelog.js b/antd-tools/utils/getChangelog.js index 381183e94..b22396784 100644 --- a/antd-tools/utils/getChangelog.js +++ b/antd-tools/utils/getChangelog.js @@ -1,10 +1,7 @@ const fs = require('fs'); module.exports = function getChangelog(file, version) { - const lines = fs - .readFileSync(file) - .toString() - .split('\n'); + const lines = fs.readFileSync(file).toString().split('\n'); const changeLog = []; const startPattern = new RegExp(`^## ${version}`); const stopPattern = /^## /; // 前一个版本 diff --git a/antd-tools/utils/getRunCmdEnv.js b/antd-tools/utils/getRunCmdEnv.js index 24d8ca99e..c7b474bb3 100644 --- a/antd-tools/utils/getRunCmdEnv.js +++ b/antd-tools/utils/getRunCmdEnv.js @@ -11,13 +11,7 @@ module.exports = function getRunCmdEnv() { const nodeModulesBinDir = path.join(__dirname, '../../node_modules/.bin'); Object.entries(env) - .filter( - v => - v - .slice(0, 1) - .pop() - .toLowerCase() === 'path', - ) + .filter(v => v.slice(0, 1).pop().toLowerCase() === 'path') .forEach(v => { const key = v.slice(0, 1).pop(); env[key] = env[key] ? `${nodeModulesBinDir}:${env[key]}` : nodeModulesBinDir; diff --git a/antd-tools/utils/projectHelper.js b/antd-tools/utils/projectHelper.js index 3b9a19c9f..79cdb57cc 100644 --- a/antd-tools/utils/projectHelper.js +++ b/antd-tools/utils/projectHelper.js @@ -20,7 +20,7 @@ function injectRequire() { const Module = require('module'); const oriRequire = Module.prototype.require; - Module.prototype.require = function(...args) { + Module.prototype.require = function (...args) { const moduleName = args[0]; try { return oriRequire.apply(this, args); diff --git a/components/affix/index.en-US.md b/components/affix/index.en-US.md index 009f92299..75d27a721 100644 --- a/components/affix/index.en-US.md +++ b/components/affix/index.en-US.md @@ -30,9 +30,7 @@ Please note that Affix should not cover other content on the page, especially wh **Note:** Children of `Affix` must not have the property `position: absolute`, but you can set `position: absolute` on `Affix` itself: ```html - - ... - +... ``` ## FAQ diff --git a/components/affix/index.zh-CN.md b/components/affix/index.zh-CN.md index e492b6957..7128d19a0 100644 --- a/components/affix/index.zh-CN.md +++ b/components/affix/index.zh-CN.md @@ -25,15 +25,13 @@ cover: https://gw.alipayobjects.com/zos/alicdn/tX6-md4H6/Affix.svg ### 事件 | 事件名称 | 说明 | 回调参数 | 版本 | -| -------- | ---------------------------- | ----------------- | ---- | -| change | 固定状态改变时触发的回调函数 | Function(affixed) | 无 | | +| -------- | ---------------------------- | ----------------- | ---- | --- | +| change | 固定状态改变时触发的回调函数 | Function(affixed) | 无 | | **注意:**`Affix` 内的元素不要使用绝对定位,如需要绝对定位的效果,可以直接设置 `Affix` 为绝对定位: ```html - - ... - +... ``` ## FAQ diff --git a/components/anchor/index.en-US.md b/components/anchor/index.en-US.md index 1b7ffe111..5efcf2b54 100644 --- a/components/anchor/index.en-US.md +++ b/components/anchor/index.en-US.md @@ -32,7 +32,7 @@ For displaying anchor hyperlinks on page and jumping between them. ### Events | Events Name | Description | Arguments | Version | -| --- | --- | --- | --- | +| --- | --- | --- | --- | --- | | click | set the handler to handle `click` event | Function(e: Event, link: Object) | | | change | Listening for anchor link change | (currentActiveLink: string) => void | | 1.5.0 | diff --git a/components/anchor/index.zh-CN.md b/components/anchor/index.zh-CN.md index 44412a2a5..817c757b8 100644 --- a/components/anchor/index.zh-CN.md +++ b/components/anchor/index.zh-CN.md @@ -33,7 +33,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_1-C1JwsC/Anchor.svg ### 事件 | 事件名称 | 说明 | 回调参数 | 版本 | -| -------- | ---------------------- | ----------------------------------- | ---- | +| -------- | ---------------------- | ----------------------------------- | ---- | ----- | | click | `click` 事件的 handler | Function(e: Event, link: Object) | | | change | 监听锚点链接改变 | (currentActiveLink: string) => void | | 1.5.0 | diff --git a/components/badge/index.zh-CN.md b/components/badge/index.zh-CN.md index 6d1c32e29..7765a1625 100644 --- a/components/badge/index.zh-CN.md +++ b/components/badge/index.zh-CN.md @@ -45,4 +45,4 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/6%26GF9WHwvY/Badge.svg | --- | --- | --- | --- | --- | | color | 自定义缎带的颜色 | string | - | | | placement | 缎带的位置,`start` 和 `end` 随文字方向(RTL 或 LTR)变动 | `start` \| `end` | `end` | | -| text | 缎带中填入的内容 | string \| VNode \| slot | - | | \ No newline at end of file +| text | 缎带中填入的内容 | string \| VNode \| slot | - | | diff --git a/components/breadcrumb/index.en-US.md b/components/breadcrumb/index.en-US.md index e3ce56b76..103c9245b 100644 --- a/components/breadcrumb/index.en-US.md +++ b/components/breadcrumb/index.en-US.md @@ -24,22 +24,22 @@ A breadcrumb displays the current location within a hierarchy. It allows going b ### Breadcrumb.Item -| Property | Description | Type | Default | Version | -| --- | --- | --- | --- | --- | -| href | Target of hyperlink | string | - | | -| overlay | The dropdown menu | [Menu](/components/menu) \| () => Menu | - | | +| Property | Description | Type | Default | Version | +| -------- | ------------------- | -------------------------------------- | ------- | ------- | +| href | Target of hyperlink | string | - | | +| overlay | The dropdown menu | [Menu](/components/menu) \| () => Menu | - | | #### Events -| Events Name | Description | Arguments | Version | -| -------- | -------- | -------------------- | ---- | -| click | handler to handle click event | (e:MouseEvent)=>void | - | 1.5.0 | +| Events Name | Description | Arguments | Version | +| ----------- | ----------------------------- | -------------------- | ------- | ----- | +| click | handler to handle click event | (e:MouseEvent)=>void | - | 1.5.0 | ### Breadcrumb.Separator `1.5.0` -| Property | Description | Type | Default | Version | -| -------- | ---------------- | --------- | ------- | ------- | -| - | - | - | - | - | +| Property | Description | Type | Default | Version | +| -------- | ----------- | ---- | ------- | ------- | +| - | - | - | - | - | > When using `Breadcrumb.Separator`,its parent component must be set to `separator=""`, otherwise the default separator of the parent component will appear. @@ -64,59 +64,55 @@ The link of Breadcrumb item targets `#` by default, you can use `itemRender` to ``` diff --git a/components/breadcrumb/index.zh-CN.md b/components/breadcrumb/index.zh-CN.md index 9477c22b1..8c772e914 100644 --- a/components/breadcrumb/index.zh-CN.md +++ b/components/breadcrumb/index.zh-CN.md @@ -33,14 +33,14 @@ cover: https://gw.alipayobjects.com/zos/alicdn/9Ltop8JwH/Breadcrumb.svg #### 事件 | 事件名称 | 说明 | 回调参数 | 版本 | -| -------- | -------- | -------------------- | ---- | +| -------- | -------- | -------------------- | ---- | ----- | | click | 单击事件 | (e:MouseEvent)=>void | - | 1.5.0 | ### Breadcrumb.Separator `1.5.0` | 参数 | 类型 | 默认值 | 版本 | | ---- | ---- | ------ | ---- | -| - | - | - | - | +| - | - | - | - | > 注意:在使用 `Breadcrumb.Separator` 时,其父组件的分隔符必须设置为 `separator=""`,否则会出现父组件默认的分隔符。 @@ -65,59 +65,55 @@ interface Route { ``` diff --git a/components/calendar/demo/basic.vue b/components/calendar/demo/basic.vue index 9ee729a3e..5220d3aca 100644 --- a/components/calendar/demo/basic.vue +++ b/components/calendar/demo/basic.vue @@ -36,4 +36,3 @@ export default defineComponent({ }, }); - diff --git a/components/calendar/demo/customize-header.vue b/components/calendar/demo/customize-header.vue index 0f8499acf..a0579eb5e 100644 --- a/components/calendar/demo/customize-header.vue +++ b/components/calendar/demo/customize-header.vue @@ -115,4 +115,3 @@ export default defineComponent({ }, }); - diff --git a/components/calendar/demo/notice-calendar.vue b/components/calendar/demo/notice-calendar.vue index b8024831d..d70205a15 100644 --- a/components/calendar/demo/notice-calendar.vue +++ b/components/calendar/demo/notice-calendar.vue @@ -107,4 +107,3 @@ export default defineComponent({ font-size: 28px; } - diff --git a/components/calendar/demo/select.vue b/components/calendar/demo/select.vue index 8407bdee2..0fb43f302 100644 --- a/components/calendar/demo/select.vue +++ b/components/calendar/demo/select.vue @@ -45,4 +45,3 @@ export default defineComponent({ }, }); - diff --git a/components/calendar/index.en-US.md b/components/calendar/index.en-US.md index 286d63564..b6c965280 100644 --- a/components/calendar/index.en-US.md +++ b/components/calendar/index.en-US.md @@ -17,10 +17,7 @@ When data is in the form of dates, such as schedules, timetables, prices calenda ```html // The default locale is en-US, if you want to use other locale, just set locale in entry file -globally. -// import dayjs from 'dayjs'; -// import 'dayjs/locale/zh-cn'; -// dayjs.locale('zh-cn'); +globally. // import dayjs from 'dayjs'; // import 'dayjs/locale/zh-cn'; // dayjs.locale('zh-cn'); ``` diff --git a/components/calendar/index.zh-CN.md b/components/calendar/index.zh-CN.md index 941413c8f..717c5dad1 100644 --- a/components/calendar/index.zh-CN.md +++ b/components/calendar/index.zh-CN.md @@ -17,10 +17,8 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/dPQmLq08DI/Calendar.svg **注意:**Calendar 部分 locale 是从 value 中读取,所以请先正确设置 dayjs 的 locale。 ```html -// 默认语言为 en-US,所以如果需要使用其他语言,推荐在入口文件全局设置 locale -// import dayjs from 'dayjs'; -// import 'dayjs/locale/zh-cn'; -// dayjs.locale('zh-cn'); +// 默认语言为 en-US,所以如果需要使用其他语言,推荐在入口文件全局设置 locale // import dayjs from +'dayjs'; // import 'dayjs/locale/zh-cn'; // dayjs.locale('zh-cn'); ``` @@ -38,7 +36,7 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/dPQmLq08DI/Calendar.svg | validRange | 设置可以显示的日期 | \[[dayjs](https://day.js.org/), [dayjs](https://day.js.org/)] | 无 | | | value(v-model) | 展示日期 | [dayjs](https://day.js.org/) | 当前日期 | | | headerRender | 自定义头部内容 | v-slot:headerRender="{value: dayjs, type: string, onChange: f(), onTypeChange: f()}" | - | | -| valueFormat | 可选,绑定值的格式,对 value、defaultValue 起作用。不指定则绑定值为 dayjs 对象 | string,[具体格式](https://day.js.org/docs/zh-CN/display/format) | - | | +| valueFormat | 可选,绑定值的格式,对 value、defaultValue 起作用。不指定则绑定值为 dayjs 对象 | string,[具体格式](https://day.js.org/docs/zh-CN/display/format) | - | | ### 事件 diff --git a/components/carousel/index.zh-CN.md b/components/carousel/index.zh-CN.md index 2a1611952..ce56d3a35 100644 --- a/components/carousel/index.zh-CN.md +++ b/components/carousel/index.zh-CN.md @@ -6,8 +6,7 @@ subtitle: 走马灯 cover: https://gw.alipayobjects.com/zos/antfincdn/%24C9tmj978R/Carousel.svg --- - -旋转木马,一组轮播的区域。 +旋转木马,一组轮播的区域。 ## 何时使用 diff --git a/components/checkbox/index.en-US.md b/components/checkbox/index.en-US.md index 099ecc575..d4f6a5364 100644 --- a/components/checkbox/index.en-US.md +++ b/components/checkbox/index.en-US.md @@ -18,13 +18,13 @@ Checkbox component. #### Checkbox -| Property | Description | Type | Default | Version | -| ---------------- | ------------------------------------------- | ------- | ------- | ------- | -| autofocus | get focus when component mounted | boolean | false | | -| checked(v-model) | Specifies whether the checkbox is selected. | boolean | false | | -| disabled | Disable checkbox | boolean | false | | -| indeterminate | indeterminate checked state of checkbox | boolean | false | | -| value | value of checkbox in CheckboxGroup | boolean \| string \| number | - | | +| Property | Description | Type | Default | Version | +| --- | --- | --- | --- | --- | +| autofocus | get focus when component mounted | boolean | false | | +| checked(v-model) | Specifies whether the checkbox is selected. | boolean | false | | +| disabled | Disable checkbox | boolean | false | | +| indeterminate | indeterminate checked state of checkbox | boolean | false | | +| value | value of checkbox in CheckboxGroup | boolean \| string \| number | - | | #### events diff --git a/components/checkbox/index.zh-CN.md b/components/checkbox/index.zh-CN.md index 0a0109cfa..03c1cc9b3 100644 --- a/components/checkbox/index.zh-CN.md +++ b/components/checkbox/index.zh-CN.md @@ -19,13 +19,13 @@ cover: https://gw.alipayobjects.com/zos/alicdn/8nbVbHEm_/CheckBox.svg #### Checkbox -| 参数 | 说明 | 类型 | 默认值 | 版本 | -| ---------------- | --------------------------------------- | ------- | ------ | ---- | -| autofocus | 自动获取焦点 | boolean | false | | -| checked(v-model) | 指定当前是否选中 | boolean | false | | -| disabled | 失效状态 | boolean | false | | -| indeterminate | 设置 indeterminate 状态,只负责样式控制 | boolean | false | | -| value | 与 CheckboxGroup 组合使用时的值 | boolean \| string \| number | - | | +| 参数 | 说明 | 类型 | 默认值 | 版本 | +| --- | --- | --- | --- | --- | +| autofocus | 自动获取焦点 | boolean | false | | +| checked(v-model) | 指定当前是否选中 | boolean | false | | +| disabled | 失效状态 | boolean | false | | +| indeterminate | 设置 indeterminate 状态,只负责样式控制 | boolean | false | | +| value | 与 CheckboxGroup 组合使用时的值 | boolean \| string \| number | - | | #### 事件 diff --git a/components/collapse/index.zh-CN.md b/components/collapse/index.zh-CN.md index 03317adc3..3915b837c 100644 --- a/components/collapse/index.zh-CN.md +++ b/components/collapse/index.zh-CN.md @@ -36,11 +36,11 @@ cover: https://gw.alipayobjects.com/zos/alicdn/IxH16B9RD/Collapse.svg ### Collapse.Panel -| 参数 | 说明 | 类型 | 默认值 | 版本 | -| ----------- | ------------------------------------------ | ---------------- | ------ | ----- | -| collapsible | 是否可折叠或指定可折叠触发区域 | `header` \| `disabled` | - | 3.0 | -| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | | -| header | 面板头内容 | string\|slot | 无 | | -| key | 对应 activeKey | string \| number | 无 | | -| showArrow | 是否展示当前面板上的箭头 | boolean | `true` | | -| extra | 自定义渲染每个面板右上角的内容 | VNode \| slot | - | 1.5.0 | +| 参数 | 说明 | 类型 | 默认值 | 版本 | +| ----------- | ------------------------------ | ---------------------- | ------ | ----- | +| collapsible | 是否可折叠或指定可折叠触发区域 | `header` \| `disabled` | - | 3.0 | +| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | | +| header | 面板头内容 | string\|slot | 无 | | +| key | 对应 activeKey | string \| number | 无 | | +| showArrow | 是否展示当前面板上的箭头 | boolean | `true` | | +| extra | 自定义渲染每个面板右上角的内容 | VNode \| slot | - | 1.5.0 | diff --git a/components/date-picker/demo/basic.vue b/components/date-picker/demo/basic.vue index eb50420b1..f51e4b7d2 100644 --- a/components/date-picker/demo/basic.vue +++ b/components/date-picker/demo/basic.vue @@ -19,10 +19,10 @@ Basic use case. Users can select or input a date in panel. - diff --git a/components/date-picker/demo/suffix.vue b/components/date-picker/demo/suffix.vue index 900606966..ab4490a3e 100644 --- a/components/date-picker/demo/suffix.vue +++ b/components/date-picker/demo/suffix.vue @@ -39,9 +39,9 @@ Customize the suffix icon through `suffixIcon` - + - + - diff --git a/components/time-picker/demo/addon.vue b/components/time-picker/demo/addon.vue index 1fce552ff..1ed286042 100644 --- a/components/time-picker/demo/addon.vue +++ b/components/time-picker/demo/addon.vue @@ -60,5 +60,3 @@ export default defineComponent({ }, }); - - diff --git a/components/time-picker/demo/disabled.vue b/components/time-picker/demo/disabled.vue index ba91e5506..ec7ef0e34 100644 --- a/components/time-picker/demo/disabled.vue +++ b/components/time-picker/demo/disabled.vue @@ -30,4 +30,3 @@ export default defineComponent({ }, }); - diff --git a/components/time-picker/demo/hide-column.vue b/components/time-picker/demo/hide-column.vue index 639b35da3..db2b3c12f 100644 --- a/components/time-picker/demo/hide-column.vue +++ b/components/time-picker/demo/hide-column.vue @@ -33,4 +33,3 @@ export default defineComponent({ }, }); - diff --git a/components/time-picker/demo/index.vue b/components/time-picker/demo/index.vue index 2ee3ce3ad..4f26cc770 100644 --- a/components/time-picker/demo/index.vue +++ b/components/time-picker/demo/index.vue @@ -1,8 +1,8 @@