chore: format code (#11397)

This commit is contained in:
btea 2023-02-02 20:26:00 +08:00 committed by GitHub
parent 9933cceba5
commit 19bb7229fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 48 additions and 44 deletions

View File

@ -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);

View File

@ -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

View File

@ -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<DeprecatedTag /> | 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<DeprecatedTag /> | Works the same as the header slot. Use that instead. |
| footer | Drawer footer Section |
| footer | Drawer footer Section |
## Drawer Methods

View File

@ -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

View File

@ -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 | — | — |

View File

@ -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` |

View File

@ -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

View File

@ -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 |

View File

@ -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 | — | — |

View File

@ -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

View File

@ -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) | — | — |

View File

@ -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<void \| undefined \| null \| boolean \| File \| Blob>` | — | 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<boolean>` | — | No |
| `file-list` / `v-model:file-list` | default uploaded files. | `UploadUserFile[]` | `[]` | No |

View File

@ -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'
```

View File

@ -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;