From ddbf9df05d4c94e98cf94af57499569511fd33fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Tue, 15 Nov 2022 11:37:18 +0800 Subject: [PATCH] chore: update docs and fix bugs --- components.json | 2 +- examples/docs/en-US/progress.md | 4 +- examples/docs/en-US/statistic.md | 20 ++- examples/docs/es/progress.md | 4 +- examples/docs/es/statistic.md | 20 ++- examples/docs/fr-FR/progress.md | 4 +- examples/docs/fr-FR/statistic.md | 217 +++++++++++++++++++++++++++- examples/docs/zh-CN/progress.md | 4 +- examples/docs/zh-CN/statistic.md | 18 +-- packages/select/src/option.vue | 23 --- packages/theme-chalk/src/index.scss | 1 - src/index.js | 6 - 12 files changed, 256 insertions(+), 67 deletions(-) diff --git a/components.json b/components.json index 27f0b103..76515c41 100644 --- a/components.json +++ b/components.json @@ -80,7 +80,7 @@ "cascader-panel": "./packages/cascader-panel/index.js", "avatar": "./packages/avatar/index.js", "drawer": "./packages/drawer/index.js", - "statistic": "./packages/statistic/index.js" + "statistic": "./packages/statistic/index.js", "popconfirm": "./packages/popconfirm/index.js", "skeleton": "./packages/skeleton/index.js", "skeleton-item": "./packages/skeleton-item/index.js", diff --git a/examples/docs/en-US/progress.md b/examples/docs/en-US/progress.md index bba04431..b396ba09 100644 --- a/examples/docs/en-US/progress.md +++ b/examples/docs/en-US/progress.md @@ -171,4 +171,6 @@ You also can specify `type` attribute to `dashboard` to use dashboard progress b | width | the canvas width of circle progress bar | number | — | 126 | | show-text | whether to show percentage | boolean | — | true | | stroke-linecap | circle/dashboard type shape at the end path | string | butt/round/square | round | -| format | custom text format | function(percentage) | — | — | \ No newline at end of file +| format | custom text format | function(percentage) | — | — | +| define-back-color | background color of progress bar (hex format) | string | — | — | +| text-color | text color of progress bar (hex format) | string | — | — | \ No newline at end of file diff --git a/examples/docs/en-US/statistic.md b/examples/docs/en-US/statistic.md index ed46adb2..d4072a12 100644 --- a/examples/docs/en-US/statistic.md +++ b/examples/docs/en-US/statistic.md @@ -2,8 +2,6 @@ Used to highlight a certain number or group of numbers, such as showing a numerical value, such as a dollar amount, ranking, etc. - - Countdown mode @@ -16,7 +14,7 @@ The component provides a thousandth place display, but you can use rate to set t
- +
@@ -31,7 +29,7 @@ The component provides a thousandth place display, but you can use rate to set t
- + @@ -94,14 +92,14 @@ If you need to add time to the original, please note that the overall time (the
- +
- + @@ -122,7 +120,7 @@ If you need to add time to the original, please note that the overall time (the
万事成蹉跎
- + @@ -177,14 +175,14 @@ export default { | Attribute | Description | Type | Accepted Values | Default | |------------- |---------------- |---------------- |---------------------- |-------- | | value | Numerical content | string \| number | - | - | -| decimalSeparator | Setting the decimal point | string | - | . | +| decimal-separator | Setting the decimal point | string | - | . | | formatter | Custom numerical presentation| v-slot \|({value}) => VNode | - | - | -| groupSeparator | Sets the thousandth identifier | string | - | , | +| group-separator | Sets the thousandth identifier | string | - | , | | precision | numerical precision | number | - | 0 | | prefix | Sets the prefix of a number | string \| v-slot | - | - | | suffix |Sets the suffix of a number | string \| v-slot | - | - | | title | Numeric titles | string \| v-slot | - | - | -| valueStyle | Styles numeric values | style | - | - | +| value-style | Styles numeric values | style | - | - | | rate | Set the ratio | number | - | 1000 | @@ -201,7 +199,7 @@ export default { | Attribute | Description | Type | Options | Default | |------------- |---------------- |---------------- |---------------------- |-------- | -| timeIndices | Whether to enable the countdown function | boolean | true\|false | false | +| time-indices | Whether to enable the countdown function | boolean | true\|false | false | | value | Required value, enter the bound value | string | — | — | | format | Formatting the countdown display | string | — | 'HH:mm:ss' | ### Statistic.Countdown Events diff --git a/examples/docs/es/progress.md b/examples/docs/es/progress.md index 8ecc119c..4191ead0 100644 --- a/examples/docs/es/progress.md +++ b/examples/docs/es/progress.md @@ -169,4 +169,6 @@ Puede utilizar el atributo `color` para establecer el color de la barra de progr | width | ancho del canvas que contiene la barra de progreso circula | number | — | 126 | | show-text | mostrar porcentaje | boolean | — | true | | stroke-linecap | circle/dashboard tipo de diseño al final del camino | string | butt/round/square | round | -| format | personalizar el formato de texto estableciendo format | function(percentage) | — | — | \ No newline at end of file +| format | personalizar el formato de texto estableciendo format | function(percentage) | — | — | +| define-back-color | background color of progress bar (hex format) | string | — | — | +| text-color | text color of progress bar (hex format) | string | — | — | \ No newline at end of file diff --git a/examples/docs/es/statistic.md b/examples/docs/es/statistic.md index ed46adb2..ed8405da 100644 --- a/examples/docs/es/statistic.md +++ b/examples/docs/es/statistic.md @@ -2,8 +2,6 @@ Used to highlight a certain number or group of numbers, such as showing a numerical value, such as a dollar amount, ranking, etc. - - Countdown mode @@ -16,7 +14,7 @@ The component provides a thousandth place display, but you can use rate to set t
- +
@@ -31,7 +29,7 @@ The component provides a thousandth place display, but you can use rate to set t
- + @@ -94,14 +92,14 @@ If you need to add time to the original, please note that the overall time (the
- +
- + @@ -122,7 +120,7 @@ If you need to add time to the original, please note that the overall time (the
万事成蹉跎
- + @@ -177,14 +175,14 @@ export default { | Attribute | Description | Type | Accepted Values | Default | |------------- |---------------- |---------------- |---------------------- |-------- | | value | Numerical content | string \| number | - | - | -| decimalSeparator | Setting the decimal point | string | - | . | +| decimal-separator | Setting the decimal point | string | - | . | | formatter | Custom numerical presentation| v-slot \|({value}) => VNode | - | - | -| groupSeparator | Sets the thousandth identifier | string | - | , | +| group-separator | Sets the thousandth identifier | string | - | , | | precision | numerical precision | number | - | 0 | | prefix | Sets the prefix of a number | string \| v-slot | - | - | | suffix |Sets the suffix of a number | string \| v-slot | - | - | | title | Numeric titles | string \| v-slot | - | - | -| valueStyle | Styles numeric values | style | - | - | +| value-style | Styles numeric values | style | - | - | | rate | Set the ratio | number | - | 1000 | @@ -201,7 +199,7 @@ export default { | Attribute | Description | Type | Options | Default | |------------- |---------------- |---------------- |---------------------- |-------- | -| timeIndices | Whether to enable the countdown function | boolean | true\|false | false | +| time-indices | Whether to enable the countdown function | boolean | true\|false | false | | value | Required value, enter the bound value | string | — | — | | format | Formatting the countdown display | string | — | 'HH:mm:ss' | ### Statistic.Countdown Events diff --git a/examples/docs/fr-FR/progress.md b/examples/docs/fr-FR/progress.md index 347eb44d..36e792f2 100644 --- a/examples/docs/fr-FR/progress.md +++ b/examples/docs/fr-FR/progress.md @@ -172,4 +172,6 @@ Vous pouvez également spécifier l'attribut `type` de `dashboard` pour utiliser | width | La largeur du canvas dans le cas d'une barre circulaire. | number | — | 126 | | show-text | Si le pourcentage doit être affiché. | boolean | — | true | | stroke-linecap | circle/dashboard type shape at the end path | string | butt/round/square | round | -| format | Vous pouvez personnaliser le format du texte en définissant le format | function(percentage) | — | — | \ No newline at end of file +| format | Vous pouvez personnaliser le format du texte en définissant le format | function(percentage) | — | — | +| define-back-color | background color of progress bar (hex format) | string | — | — | +| text-color | text color of progress bar (hex format) | string | — | — | \ No newline at end of file diff --git a/examples/docs/fr-FR/statistic.md b/examples/docs/fr-FR/statistic.md index 2d762eb9..d4072a12 100644 --- a/examples/docs/fr-FR/statistic.md +++ b/examples/docs/fr-FR/statistic.md @@ -1 +1,216 @@ -## Statistic +## Statistic + +Used to highlight a certain number or group of numbers, such as showing a numerical value, such as a dollar amount, ranking, etc. + +Countdown mode + + +### Basic usage +The component provides a thousandth place display, but you can use rate to set the 10,000th place, and so on +:::demo +```html + + + + +``` +::: + + +### 倒计时 +:::warning +Suspend is tentative, it ** just pauses the countdown, not the time, because value points to a future time node ** + +If you need to add time to the original, please note that the overall time (the amount of time added and the original time) must be a ** future ** time node, otherwise it is still the end of the countdown +::: +:::demo Providing a future time via 'value' will enable the countdown function +```html + + + + +``` +::: + + + + +### Statistic Attributes + +| Attribute | Description | Type | Accepted Values | Default | +|------------- |---------------- |---------------- |---------------------- |-------- | +| value | Numerical content | string \| number | - | - | +| decimal-separator | Setting the decimal point | string | - | . | +| formatter | Custom numerical presentation| v-slot \|({value}) => VNode | - | - | +| group-separator | Sets the thousandth identifier | string | - | , | +| precision | numerical precision | number | - | 0 | +| prefix | Sets the prefix of a number | string \| v-slot | - | - | +| suffix |Sets the suffix of a number | string \| v-slot | - | - | +| title | Numeric titles | string \| v-slot | - | - | +| value-style | Styles numeric values | style | - | - | +| rate | Set the ratio | number | - | 1000 | + + +### Statistic Slots +| Name | Description | +|------|--------| +| prefix | Numeric prefix | +| suffix | Suffixes for numeric values | +| formatter | Numerical content | +| title | Numeric titles | + + +### Statistic.Countdown Attributes + +| Attribute | Description | Type | Options | Default | +|------------- |---------------- |---------------- |---------------------- |-------- | +| time-indices | Whether to enable the countdown function | boolean | true\|false | false | +| value | Required value, enter the bound value | string | — | — | +| format | Formatting the countdown display | string | — | 'HH:mm:ss' | +### Statistic.Countdown Events +| Method | Description | Parameters | +|---------|--------|---------| +| change | Enable in the 'countdown' function | (value: Date) | +| finish | Launched after the 'countdown' is complete | (value: boolean) | + +### Statistic Methods +| Method | Description | Parameters |CallBack| +| ---- | ---- | ---- |---- | +| suspend | Pause the countdown|(value:boolean) |(value: Date) | + + diff --git a/examples/docs/zh-CN/progress.md b/examples/docs/zh-CN/progress.md index c3e916d1..74b542f2 100644 --- a/examples/docs/zh-CN/progress.md +++ b/examples/docs/zh-CN/progress.md @@ -175,4 +175,6 @@ Progress 组件可通过 `type` 属性来指定使用环形进度条,在环形 | width | 环形进度条画布宽度(只在 type 为 circle 或 dashboard 时可用) | number | | 126 | | show-text | 是否显示进度条文字内容 | boolean | — | true | | stroke-linecap | circle/dashboard 类型路径两端的形状 | string | butt/round/square | round | -| format | 指定进度条文字内容 | function(percentage) | — | — | \ No newline at end of file +| format | 指定进度条文字内容 | function(percentage) | — | — | +| define-back-color | 指定进度条底色(支持 hex 格式) | string | — | — | +| text-color | 指定进度条字体颜色(支持 hex 格式) | string | — | — | diff --git a/examples/docs/zh-CN/statistic.md b/examples/docs/zh-CN/statistic.md index 8ea864f6..62402f98 100644 --- a/examples/docs/zh-CN/statistic.md +++ b/examples/docs/zh-CN/statistic.md @@ -14,7 +14,7 @@
- +
@@ -29,7 +29,7 @@
- + @@ -92,14 +92,14 @@ suspend 暂定,它**只是暂停倒计时,并非暂停了时间,因为valu
- +
- + @@ -120,7 +120,7 @@ suspend 暂定,它**只是暂停倒计时,并非暂停了时间,因为valu
万事成蹉跎
- + @@ -175,14 +175,14 @@ export default { | 参数 | 说明 | 类型 | 可选值 | 默认值 | |------------- |---------------- |---------------- |---------------------- |-------- | | value | 数值内容 | string \| number | - | - | -| decimalSeparator | 设置小数点 | string | - | . | +| decimal-separator | 设置小数点 | string | - | . | | formatter | 自定义数值展示| v-slot \|({value}) => VNode | - | - | -| groupSeparator | 设置千分位标识符 | string | - | , | +| group-separator | 设置千分位标识符 | string | - | , | | precision | 数值精度 | number | - | 0 | | prefix | 设置数值的前缀 | string \| v-slot | - | - | | suffix |设置数值的后缀 | string \| v-slot | - | - | | title | 数值的标题 | string \| v-slot | - | - | -| valueStyle | 设置数值的样式 | style | - | - | +| value-style | 设置数值的样式 | style | - | - | | rate | 设置倍率 | number | - | 1000 | @@ -199,7 +199,7 @@ export default { | 参数 | 说明 | 类型 | 可选值 | 默认值 | |------------- |---------------- |---------------- |---------------------- |-------- | -| timeIndices | 是否开启倒计时功能 | boolean | true\|false | false | +| time-indices | 是否开启倒计时功能 | boolean | true\|false | false | | value | 必填值,输入绑定值 | string | — | — | | format | 格式化倒计时展示 | string | — | 'HH:mm:ss' | ### Statistic.Countdown Events diff --git a/packages/select/src/option.vue b/packages/select/src/option.vue index 36ad58e6..a343b5b9 100644 --- a/packages/select/src/option.vue +++ b/packages/select/src/option.vue @@ -37,10 +37,6 @@ disabled: { type: Boolean, default: false - }, - selectedColor: { - type: String, - default: '#409EFF' } }, @@ -135,24 +131,6 @@ selectOptionClick() { if (this.disabled !== true && this.groupDisabled !== true) { this.dispatch('ElSelect', 'handleOptionClick', [this, true]); - if (this.selectedColor !== '#409EFF') { - // 如果不是默认的颜色 - if (this.$el.className === 'el-select-dropdown__item selected hover' || - this.$el.className === 'el-select-dropdown__item hover' - ) { - let siblingsNode = this.$parent.$children; - siblingsNode.forEach(item=>{ - if (item.$el.className === 'el-select-dropdown__item' || - item.$el.className === 'el-select-dropdown__item selected') { - item.$el.style.color = '#606266'; - } - }); - this.$el.style.color = this.selectedColor; - } else { - this.$el.style.color = '#606266'; - } - - } } }, @@ -172,7 +150,6 @@ this.$on('queryChange', this.queryChange); this.$on('handleGroupDisabled', this.handleGroupDisabled); - }, beforeDestroy() { diff --git a/packages/theme-chalk/src/index.scss b/packages/theme-chalk/src/index.scss index a965f9ef..00183c6f 100644 --- a/packages/theme-chalk/src/index.scss +++ b/packages/theme-chalk/src/index.scss @@ -85,4 +85,3 @@ @import "./descriptions.scss"; @import "./descriptions-item.scss"; @import "./result.scss"; - diff --git a/src/index.js b/src/index.js index 7ee3ad63..4a190392 100644 --- a/src/index.js +++ b/src/index.js @@ -81,9 +81,7 @@ import PageHeader from '../packages/page-header/index.js'; import CascaderPanel from '../packages/cascader-panel/index.js'; import Avatar from '../packages/avatar/index.js'; import Drawer from '../packages/drawer/index.js'; - import Statistic from '../packages/statistic/index.js'; - import Popconfirm from '../packages/popconfirm/index.js'; import Skeleton from '../packages/skeleton/index.js'; import SkeletonItem from '../packages/skeleton-item/index.js'; @@ -91,7 +89,6 @@ import Empty from '../packages/empty/index.js'; import Descriptions from '../packages/descriptions/index.js'; import DescriptionsItem from '../packages/descriptions-item/index.js'; import Result from '../packages/result/index.js'; - import locale from 'element-ui/src/locale'; import CollapseTransition from 'element-ui/src/transitions/collapse-transition'; @@ -301,9 +298,7 @@ export default { CascaderPanel, Avatar, Drawer, - Statistic, - Popconfirm, Skeleton, SkeletonItem, @@ -311,5 +306,4 @@ export default { Descriptions, DescriptionsItem, Result - };