From 19bb7229fc8ce478c5dc60a57f13540db5a6a125 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Thu, 2 Feb 2023 20:26:00 +0800 Subject: [PATCH] chore: format code (#11397) --- .../.vitepress/vitepress/styles/css-vars.scss | 2 +- docs/en-US/component/card.md | 10 ++-- docs/en-US/component/drawer.md | 48 +++++++++---------- docs/en-US/component/image.md | 2 +- docs/en-US/component/message-box.md | 2 +- docs/en-US/component/rate.md | 8 ++-- docs/en-US/component/skeleton.md | 2 +- docs/en-US/component/table.md | 2 +- docs/en-US/component/tree-select.md | 4 +- docs/en-US/component/tree-v2.md | 2 +- docs/en-US/component/tree.md | 2 +- docs/en-US/component/upload.md | 2 +- docs/en-US/guide/i18n.md | 1 + packages/theme-chalk/src/menu.scss | 5 +- 14 files changed, 48 insertions(+), 44 deletions(-) diff --git a/docs/.vitepress/vitepress/styles/css-vars.scss b/docs/.vitepress/vitepress/styles/css-vars.scss index 55311ec2d6..fb8a2c6d0b 100644 --- a/docs/.vitepress/vitepress/styles/css-vars.scss +++ b/docs/.vitepress/vitepress/styles/css-vars.scss @@ -68,7 +68,7 @@ --code-text-color: var(--text-color); --code-font-family: var(--font-family-mono); --code-tooltip-bg-color: var(--code-bg-color); - --code-tooltip-color: #0C61C9; + --code-tooltip-color: #0c61c9; // tip block --block-tip-bg-color: rgba(var(--el-color-primary-rgb), 0.1); diff --git a/docs/en-US/component/card.md b/docs/en-US/component/card.md index a8786a3443..290c0e1256 100644 --- a/docs/en-US/component/card.md +++ b/docs/en-US/component/card.md @@ -51,11 +51,11 @@ card/shadow ### Attributes -| Name | Description | Type | Default | -| ---------- | ------------------------------------------------------------- | --------------------------------- | --------------------- | -| header | title of the card. Also accepts a DOM passed by `slot#header` | ^[string] | — | -| body-style | CSS style of card body | ^[object]`CSSProperties` | — | -| shadow | when to show card shadows | ^[enum]`always \| never \| hover` | always | +| Name | Description | Type | Default | +| ---------- | ------------------------------------------------------------- | --------------------------------- | ------- | +| header | title of the card. Also accepts a DOM passed by `slot#header` | ^[string] | — | +| body-style | CSS style of card body | ^[object]`CSSProperties` | — | +| shadow | when to show card shadows | ^[enum]`always \| never \| hover` | always | ### Slots diff --git a/docs/en-US/component/drawer.md b/docs/en-US/component/drawer.md index e257eb6d61..66a0c51655 100644 --- a/docs/en-US/component/drawer.md +++ b/docs/en-US/component/drawer.md @@ -83,26 +83,26 @@ Drawer provides an API called `destroyOnClose`, which is a flag variable that in ## Drawer Attributes -| Name | Description | Type | Acceptable Values | Default | -| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------- | ------- | -| model-value / v-model | Should Drawer be displayed | boolean | — | false | -| append-to-body | Controls should Drawer be inserted to DocumentBody Element, nested Drawer must assign this param to **true** | boolean | — | false | -| lock-scroll | whether scroll of body is disabled while Drawer is displayed | boolean | — | true | -| before-close | If set, closing procedure will be halted | function(done) (done is function type that accepts a boolean as parameter, calling done with true or without parameter will abort the close procedure) | — | — | -| close-on-click-modal | whether the Drawer can be closed by clicking the mask | boolean | — | true | -| close-on-press-escape | Indicates whether Drawer can be closed by pressing ESC | boolean | — | true | -| open-delay | Time(milliseconds) before open | number | — | 0 | -| close-delay | Time(milliseconds) before close | number | — | 0 | +| Name | Description | Type | Acceptable Values | Default | +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------- | ------- | +| model-value / v-model | Should Drawer be displayed | boolean | — | false | +| append-to-body | Controls should Drawer be inserted to DocumentBody Element, nested Drawer must assign this param to **true** | boolean | — | false | +| lock-scroll | whether scroll of body is disabled while Drawer is displayed | boolean | — | true | +| before-close | If set, closing procedure will be halted | function(done) (done is function type that accepts a boolean as parameter, calling done with true or without parameter will abort the close procedure) | — | — | +| close-on-click-modal | whether the Drawer can be closed by clicking the mask | boolean | — | true | +| close-on-press-escape | Indicates whether Drawer can be closed by pressing ESC | boolean | — | true | +| open-delay | Time(milliseconds) before open | number | — | 0 | +| close-delay | Time(milliseconds) before close | number | — | 0 | | custom-class | Extra class names for Drawer | string | — | — | -| destroy-on-close | Indicates whether children should be destroyed after Drawer closed | boolean | - | false | -| modal | Should show shadowing layer | boolean | — | true | -| direction | Drawer's opening direction | Direction | rtl / ltr / ttb / btt | rtl | -| show-close | Should show close button at the top right of Drawer | boolean | — | true | -| size | Drawer's size, if Drawer is horizontal mode, it effects the width property, otherwise it effects the height property, when size is `number` type, it describes the size by unit of pixels; when size is `string` type, it should be used with `x%` notation, other wise it will be interpreted to pixel unit | number / string | - | '30%' | -| title | Drawer's title, can also be set by named slot, detailed descriptions can be found in the slot form | string | — | — | -| withHeader | Flag that controls the header section's existance, default to true, when withHeader set to false, both `title attribute` and `title slot` won't work | boolean | - | true | -| modal-class | Extra class names for shadowing layer | string | - | - | -| z-index | set z-index | number | - | - | +| destroy-on-close | Indicates whether children should be destroyed after Drawer closed | boolean | - | false | +| modal | Should show shadowing layer | boolean | — | true | +| direction | Drawer's opening direction | Direction | rtl / ltr / ttb / btt | rtl | +| show-close | Should show close button at the top right of Drawer | boolean | — | true | +| size | Drawer's size, if Drawer is horizontal mode, it effects the width property, otherwise it effects the height property, when size is `number` type, it describes the size by unit of pixels; when size is `string` type, it should be used with `x%` notation, other wise it will be interpreted to pixel unit | number / string | - | '30%' | +| title | Drawer's title, can also be set by named slot, detailed descriptions can be found in the slot form | string | — | — | +| withHeader | Flag that controls the header section's existance, default to true, when withHeader set to false, both `title attribute` and `title slot` won't work | boolean | - | true | +| modal-class | Extra class names for shadowing layer | string | - | - | +| z-index | set z-index | number | - | - | :::warning @@ -112,12 +112,12 @@ Drawer provides an API called `destroyOnClose`, which is a flag variable that in ## Drawer Slots -| Name | Description | -| ----------------- | ---------------------------------------------------------------------------------------------- | -| — | Drawer's Content | -| header | Drawer header section; Replacing this removes the title, but does not remove the close button. | +| Name | Description | +| ---------------------- | ---------------------------------------------------------------------------------------------- | +| — | Drawer's Content | +| header | Drawer header section; Replacing this removes the title, but does not remove the close button. | | title | Works the same as the header slot. Use that instead. | -| footer | Drawer footer Section | +| footer | Drawer footer Section | ## Drawer Methods diff --git a/docs/en-US/component/image.md b/docs/en-US/component/image.md index 6b4fd99c51..b5e5d7ef5b 100644 --- a/docs/en-US/component/image.md +++ b/docs/en-US/component/image.md @@ -104,7 +104,7 @@ image/image-preview | `infinite` | whether preview is infinite. | `boolean` | `true` | | `hide-on-click-modal` | whether user can emit close event when clicking backdrop. | `boolean` | `false` | | `teleported` | whether to append image itself to body. A nested parent element attribute transform should have this attribute set to `true`. | `boolean` | `false` | -| `zoom-rate` | the zoom rate of the image viewer zoom event | `number` | `1.2` | +| `zoom-rate` | the zoom rate of the image viewer zoom event | `number` | `1.2` | ### Image Viewer Events diff --git a/docs/en-US/component/message-box.md b/docs/en-US/component/message-box.md index 342939c31c..cb5d896b38 100644 --- a/docs/en-US/component/message-box.md +++ b/docs/en-US/component/message-box.md @@ -191,4 +191,4 @@ The corresponding methods are: `ElMessageBox`, `ElMessageBox.alert`, `ElMessageB | draggable | whether MessageBox is draggable | boolean | — | false | | round-button | whether to use round button | boolean | — | false | | button-size | custom size of confirm and cancel buttons | string | small / default / large | default | -| append-to | set the root element for the message box | string \| HTMLElement | — | — | +| append-to | set the root element for the message box | string \| HTMLElement | — | — | diff --git a/docs/en-US/component/rate.md b/docs/en-US/component/rate.md index bb681a0c77..ddbc0a2c4b 100644 --- a/docs/en-US/component/rate.md +++ b/docs/en-US/component/rate.md @@ -77,7 +77,7 @@ Use `css/scss` language to change the global or local color. We set some global ### Default Variables | Variable | Default Color | -|-------------------------------|-------------------------------| +| ----------------------------- | ----------------------------- | | --el-rate-void-color | var(--el-border-color-darker) | | --el-rate-fill-color | #f7ba2a | | --el-rate-disabled-void-color | var(--el-fill-color) | @@ -88,7 +88,7 @@ Use `css/scss` language to change the global or local color. We set some global ### Attributes | Name | Description | Type | Default | -|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|--------------------------------------------------------------------| +| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- | ------------------------------------------------------------------ | | model-value / v-model | binding value | ^[number] | 0 | | max | max rating score | ^[number] | 5 | | size | size of Rate | ^[enum]`'large' \| 'default' \| 'small'` | — | @@ -114,12 +114,12 @@ Use `css/scss` language to change the global or local color. We set some global ### Events | Name | Description | Type | -|--------|-------------------------------------|--------------------------------------| +| ------ | ----------------------------------- | ------------------------------------ | | change | Triggers when rate value is changed | ^[Function]`(value: number) => void` | ### Exposes | Name | Description | Type | -|-------------------|---------------------|--------------------------------------| +| ----------------- | ------------------- | ------------------------------------ | | setCurrentValue | set current value | ^[Function]`(value: number) => void` | | resetCurrentValue | reset current value | ^[Function]`() => void` | diff --git a/docs/en-US/component/skeleton.md b/docs/en-US/component/skeleton.md index a66f3d0b55..1d63070ec6 100644 --- a/docs/en-US/component/skeleton.md +++ b/docs/en-US/component/skeleton.md @@ -95,7 +95,7 @@ skeleton/avoiding-rendering-bouncing | `count` | how many fake items to render to the DOM | `number` | `1` | | `loading` | whether showing the real DOM | `boolean` | `false` | | `rows` | numbers of the row, only useful when no template slot were given | `number` | `3` | -| `throttle` | Rendering delay in milliseconds | `number` | `0` | +| `throttle` | Rendering delay in milliseconds | `number` | `0` | ### Skeleton Slots diff --git a/docs/en-US/component/table.md b/docs/en-US/component/table.md index 8825fee0f6..826db890f0 100644 --- a/docs/en-US/component/table.md +++ b/docs/en-US/component/table.md @@ -238,7 +238,7 @@ table/table-layout | max-height | Table's max-height. The legal value is a number or the height in px. | string / number | — | — | | stripe | whether Table is striped | boolean | — | false | | border | whether Table has vertical border | boolean | — | false | -| size | size of Table | string | large / default /small | default | +| size | size of Table | string | large / default /small | default | | fit | whether width of column automatically fits its container | boolean | — | true | | show-header | whether Table header is visible | boolean | — | true | | highlight-current-row | whether current row is highlighted | boolean | — | false | diff --git a/docs/en-US/component/tree-select.md b/docs/en-US/component/tree-select.md index 872297a4be..ae77144594 100644 --- a/docs/en-US/component/tree-select.md +++ b/docs/en-US/component/tree-select.md @@ -108,6 +108,6 @@ and please go to the original component to view the documentation. ### Own Attributes -| Name | Description | Type | Accepted Values | Default | -| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ----- | --------------- | ------- | +| Name | Description | Type | Accepted Values | Default | +| ------------------------- | ------------------------------------------------------------------------------------------------------------------- | ----- | --------------- | ------- | | cacheData **(\> 2.2.26)** | The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data | array | — | — | diff --git a/docs/en-US/component/tree-v2.md b/docs/en-US/component/tree-v2.md index b437709d4f..1428a12e03 100644 --- a/docs/en-US/component/tree-v2.md +++ b/docs/en-US/component/tree-v2.md @@ -84,7 +84,7 @@ tree-v2/filter | current-node-key | key of initially selected node | string / number | — | | filter-method | this function will be executed on each node when use filter method. if return `false`, tree node will be hidden. | Function(value, data) | — | | indent | horizontal indentation of nodes in adjacent levels in pixels | number | 16 | -| icon | custom tree node icon | `string \| Component` | - | +| icon | custom tree node icon | `string \| Component` | - | ## props diff --git a/docs/en-US/component/tree.md b/docs/en-US/component/tree.md index c618ac9097..7cce79c68f 100644 --- a/docs/en-US/component/tree.md +++ b/docs/en-US/component/tree.md @@ -137,7 +137,7 @@ tree/draggable | filter-node-method | this function will be executed on each node when use filter method. if return `false`, tree node will be hidden. | Function(value, data, node) | — | — | | accordion | whether only one node among the same level can be expanded at one time | boolean | — | false | | indent | horizontal indentation of nodes in adjacent levels in pixels | number | — | 18 | -| icon | custom tree node icon component | `string \| Component` | - | - | +| icon | custom tree node icon component | `string \| Component` | - | - | | lazy | whether to lazy load leaf node, used with `load` attribute | boolean | — | false | | draggable | whether enable tree nodes drag and drop | boolean | — | false | | allow-drag | this function will be executed before dragging a node. If `false` is returned, the node can not be dragged | Function(node) | — | — | diff --git a/docs/en-US/component/upload.md b/docs/en-US/component/upload.md index bb87c8fb19..82bafe3ee3 100644 --- a/docs/en-US/component/upload.md +++ b/docs/en-US/component/upload.md @@ -111,7 +111,7 @@ upload/manual | `on-error` | hook function when some errors occurs. | `(error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles) => void` | — | No | | `on-progress` | hook function when some progress occurs. | `(evt: UploadProgressEvent, uploadFile: UploadFile, uploadFiles: UploadFiles) => void` | — | No | | `on-change` | hook function when select file or upload file success or upload file fail. | `(uploadFile: UploadFile, uploadFiles: UploadFiles) => void` | — | No | -| `on-exceed` | hook function when limit is exceeded. | `(files: File[], uploadFiles: UploadUserFile[]) => void` | — | No | +| `on-exceed` | hook function when limit is exceeded. | `(files: File[], uploadFiles: UploadUserFile[]) => void` | — | No | | `before-upload` | hook function before uploading with the file to be uploaded as its parameter. If `false` is returned or a `Promise` is returned and then is rejected, uploading will be aborted. | `(rawFile: UploadRawFile) => Awaitable` | — | No | | `before-remove` | hook function before removing a file with the file and file list as its parameters. If `false` is returned or a `Promise` is returned and then is rejected, removing will be aborted. | `(uploadFile: UploadFile, uploadFiles: UploadFiles) => Awaitable` | — | No | | `file-list` / `v-model:file-list` | default uploaded files. | `UploadUserFile[]` | `[]` | No | diff --git a/docs/en-US/guide/i18n.md b/docs/en-US/guide/i18n.md index e98ff42179..22ef4f4a51 100644 --- a/docs/en-US/guide/i18n.md +++ b/docs/en-US/guide/i18n.md @@ -55,6 +55,7 @@ for globally configuring locale and other settings. ## Date and time localization We use [Day.js](https://day.js.org/docs/en/i18n/i18n) library to manage date and time in components like `DatePicker`. It is important to set a proper locale in Day.js to make the internationalization fully works. You have to import Day.js's locale config separately. + ``` import 'dayjs/locale/zh-cn' ``` diff --git a/packages/theme-chalk/src/menu.scss b/packages/theme-chalk/src/menu.scss index c812887e33..369242b3da 100644 --- a/packages/theme-chalk/src/menu.scss +++ b/packages/theme-chalk/src/menu.scss @@ -167,7 +167,10 @@ > .#{$namespace}-menu-item, > .#{$namespace}-sub-menu > .#{$namespace}-sub-menu__title, - > .#{$namespace}-menu-item-group > ul > .#{$namespace}-sub-menu > .#{$namespace}-sub-menu__title { + > .#{$namespace}-menu-item-group + > ul + > .#{$namespace}-sub-menu + > .#{$namespace}-sub-menu__title { [class^='#{$namespace}-icon'] { margin: 0; vertical-align: middle;