Skip to content

Commit e7cc69a

Browse files
committed
refine deprecation message
1 parent 06c5b23 commit e7cc69a

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### ⚠️ 非兼容性变更
44

5-
* [^] `Uploader` 组件在 `maxCount` 的值是 `1` 的情况下,`value` 的默认类型从字符串改成对象,可以通过设置 prop `compat``true``value` 的类型设置为字符串兼容旧版本。
5+
* [^] `Uploader` 组件在 `maxCount` 的值是 `1` 的情况下,`value` 的默认类型从字符串改成对象,可以通过设置 prop `compat``true``value` 的类型设置为字符串兼容旧版本。`compat` 模式未来不会移除,但不建议使用。
66

77
> #### 迁移指南
88
>
@@ -35,11 +35,11 @@
3535
> 使用 `Textarea` 组件进行替代:
3636
>
3737
> ```html
38-
> <veui-textarea v-model="value"/>
38+
> <veui-textarea v-model="value" .../>
3939
> ```
4040
41-
* [^] 将 `OptionGroup` 的 `position` 属性的 `popout` 值重命名为了 `popup`(与 `aria-haspopup` 保持一致)。将在下个版本移除对 `popout` 的支持。
42-
* [^] 将 `Progress` 组件的 `precision` prop 重命名为和 `NumberInput` 一致的 `decimal-place`。`precision` 将在正式版移除
41+
* [^] 将 `OptionGroup` 的 `position` 属性的 `popout` 值重命名为了 `popup`(与 `aria-haspopup` 保持一致)。将在 `1.0.0` 移除对 `popout` 的支持。
42+
* [^] 将 `Progress` 组件的 `precision` prop 重命名为和 `NumberInput` 一致的 `decimal-place`。`precision` 将在 `1.0.0` 移除
4343
4444
### 💡 主要变更
4545
@@ -303,6 +303,8 @@
303303
> }
304304
> ```
305305
306+
* [^] 将 `Pager` 组件重命名为 `Pagination`。暂时保留兼容,`Pager` 将在 `1.0.0` 移除。
307+
306308
### 🐞 问题修复
307309
308310
* [^] 修正了 `Carousel` 组件 slot 的位置。

packages/veui/src/components/Pager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import warn from '../utils/warn'
77
export default {
88
...Pagination,
99
created () {
10-
warn('[veui-pager] `Pager` is deprecated and will be removed in the next version. Use `Pagination` component instead.')
10+
warn('[veui-pager] `Pager` is deprecated and will be removed in `1.0.0`. Use `Pagination` component instead.')
1111
}
1212
}

packages/veui/src/components/Progress.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<script>
3232
import ui from '../mixins/ui'
3333
import Icon from './Icon'
34+
import warn from '../utils/warn'
3435
3536
const RADIUS_DEFAULT = 60
3637
const STROKE_DEFAULT = 2
@@ -57,7 +58,12 @@ export default {
5758
*/
5859
precision: {
5960
type: Number,
60-
default: 0
61+
default: 0,
62+
validator (val) {
63+
if (val !== 0) {
64+
warn('[veui-progress] `precision` is deprecated and will be removed in `1.0.0`. Use `decimal-place` instead.')
65+
}
66+
}
6167
},
6268
decimalPlace: {
6369
type: Number

packages/veui/src/components/Select/OptionGroup.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import outside from '../../directives/outside'
1212
import '../../common/uiTypes'
1313
import { walk } from '../../utils/data'
1414
import { isType } from '../../utils/helper'
15+
import warn from '../../utils/warn'
1516
import { pull } from 'lodash'
1617
1718
export default {
@@ -33,6 +34,9 @@ export default {
3334
type: String,
3435
default: 'inline',
3536
validator (val) {
37+
if (val === 'popout') {
38+
warn('[veui-option-group] `popout` is a deprecated value for `position` and will be removed in `v1.0.0`. Use `popup` component instead.')
39+
}
3640
return ['inline', 'popout', 'popup'].indexOf(val) !== -1
3741
}
3842
}

packages/veui/src/components/Uploader.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,9 @@ export default {
255255
type: Boolean,
256256
default: true,
257257
validator (val) {
258+
// TODO: remove support in 1.0.0
258259
if (val === false) {
259-
warn('[veui-uploader] `auto-upload` is deprecated and will be removed in the next version. Use `autoupload` instead.')
260+
warn('[veui-uploader] `auto-upload` is deprecated and will be removed in `1.0.0`. Use `autoupload` instead.')
260261
}
261262
return true
262263
}

0 commit comments

Comments
 (0)