Form verticalVue demo works fine 1`] = `
value="110000"
/>
@@ -4320,7 +4320,7 @@ exports[`Form > Form verticalVue demo works fine 1`] = `
Form verticalVue demo works fine 1`] = `
value="120000"
/>
diff --git a/src/input/input.en-US.md b/src/input/input.en-US.md
index 1d4cf818d..20b6fdac0 100644
--- a/src/input/input.en-US.md
+++ b/src/input/input.en-US.md
@@ -10,13 +10,12 @@ align | String | left | options:left/center/right | N
allowInputOverMax | Boolean | false | \- | N
autocomplete | String | undefined | \- | N
autofocus | Boolean | false | \- | N
+borderless | Boolean | false | \- | N
clearable | Boolean | false | \- | N
disabled | Boolean | - | \- | N
-errorMessage | String | - | `deprecated` | N
format | Function | - | Typescript:`InputFormatType` `type InputFormatType = (value: InputValue) => string`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/input/type.ts) | N
label | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
layout | String | horizontal | options:vertical/horizontal | N
-borderless | Boolean | false | \- | N
maxcharacter | Number | - | \- | N
maxlength | Number | - | \- | N
name | String | - | \- | N
@@ -35,6 +34,7 @@ onBlur | Function | | Typescript:`(value: InputValue, context: { e: FocusEven
onChange | Function | | Typescript:`(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' }) => void`
| N
onClear | Function | | Typescript:`(context: { e: MouseEvent }) => void`
| N
onFocus | Function | | Typescript:`(value: InputValue, context: { e: FocusEvent }) => void`
| N
+onValidate | Function | | Typescript:`(context: { error?: 'exceed-maximum' \| 'below-minimum' }) => void`
trigger on text length being over max length or max character | N
### Input Events
@@ -44,3 +44,4 @@ blur | `(value: InputValue, context: { e: FocusEvent })` | \-
change | `(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' })` | \-
clear | `(context: { e: MouseEvent })` | \-
focus | `(value: InputValue, context: { e: FocusEvent })` | \-
+validate | `(context: { error?: 'exceed-maximum' \| 'below-minimum' })` | trigger on text length being over max length or max character
diff --git a/src/input/input.md b/src/input/input.md
index beaf52f6b..d977e0222 100644
--- a/src/input/input.md
+++ b/src/input/input.md
@@ -9,13 +9,12 @@ align | String | left | 文本内容位置,居左/居中/居右。可选项:
allowInputOverMax | Boolean | false | 超出 `maxlength` 或 `maxcharacter` 之后是否允许继续输入 | N
autocomplete | String | undefined | 是否开启自动填充功能,HTML5 原生属性,[点击查看详情](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) | N
autofocus | Boolean | false | 自动聚焦 | N
+borderless | Boolean | false | 是否开启无边框模式 | N
clearable | Boolean | false | 是否可清空 | N
disabled | Boolean | - | 是否禁用输入框 | N
-errorMessage | String | - | 已废弃。错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips) | N
format | Function | - | 指定输入框展示值的格式。TS 类型:`InputFormatType` `type InputFormatType = (value: InputValue) => string`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/input/type.ts) | N
label | String / Slot / Function | - | 左侧文本。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
layout | String | horizontal | 标题输入框布局方式。可选项:vertical/horizontal | N
-borderless | Boolean | false | 是否开启无边框模式 | N
maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 | N
maxlength | Number | - | 用户最多可以输入的文本长度,一个中文等于一个计数长度。值为空,则表示不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用 | N
name | String | - | 名称 | N
@@ -34,6 +33,7 @@ onBlur | Function | | TS 类型:`(value: InputValue, context: { e: FocusEvent
onChange | Function | | TS 类型:`(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' }) => void`
输入框值发生变化时触发。`trigger=initial` 表示传入的数据不符合预期,组件自动处理后触发 change 告知父组件。如:初始值长度超过 `maxlength` 限制 | N
onClear | Function | | TS 类型:`(context: { e: MouseEvent }) => void`
清空按钮点击时触发 | N
onFocus | Function | | TS 类型:`(value: InputValue, context: { e: FocusEvent }) => void`
获得焦点时触发 | N
+onValidate | Function | | TS 类型:`(context: { error?: 'exceed-maximum' \| 'below-minimum' }) => void`
字数超出限制时触发 | N
### Input Events
@@ -43,3 +43,4 @@ blur | `(value: InputValue, context: { e: FocusEvent })` | 失去焦点时触发
change | `(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' })` | 输入框值发生变化时触发。`trigger=initial` 表示传入的数据不符合预期,组件自动处理后触发 change 告知父组件。如:初始值长度超过 `maxlength` 限制
clear | `(context: { e: MouseEvent })` | 清空按钮点击时触发
focus | `(value: InputValue, context: { e: FocusEvent })` | 获得焦点时触发
+validate | `(context: { error?: 'exceed-maximum' \| 'below-minimum' })` | 字数超出限制时触发
diff --git a/src/input/props.ts b/src/input/props.ts
index aeb65c5dc..80375a15c 100644
--- a/src/input/props.ts
+++ b/src/input/props.ts
@@ -26,15 +26,12 @@ export default {
},
/** 自动聚焦 */
autofocus: Boolean,
+ /** 是否开启无边框模式 */
+ borderless: Boolean,
/** 是否可清空 */
clearable: Boolean,
/** 是否禁用输入框 */
disabled: Boolean,
- /** 已废弃。错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips) */
- errorMessage: {
- type: String,
- default: '',
- },
/** 指定输入框展示值的格式 */
format: {
type: Function as PropType,
@@ -52,11 +49,6 @@ export default {
return ['vertical', 'horizontal'].includes(val);
},
},
- /** 是否开启无边框模式 */
- borderless: {
- type: Boolean,
- value: false,
- },
/** 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 */
maxcharacter: {
type: Number,
diff --git a/src/input/type.ts b/src/input/type.ts
index d83ff5484..e90f65c49 100644
--- a/src/input/type.ts
+++ b/src/input/type.ts
@@ -26,6 +26,11 @@ export interface TdInputProps {
* @default false
*/
autofocus?: boolean;
+ /**
+ * 是否开启无边框模式
+ * @default false
+ */
+ borderless?: boolean;
/**
* 是否可清空
* @default false
@@ -35,12 +40,6 @@ export interface TdInputProps {
* 是否禁用输入框
*/
disabled?: boolean;
- /**
- * 错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips)
- * @default ''
- * @deprecated
- */
- errorMessage?: string;
/**
* 指定输入框展示值的格式
*/
@@ -54,11 +53,6 @@ export interface TdInputProps {
* @default horizontal
*/
layout?: 'vertical' | 'horizontal';
- /**
- * 是否开启无边框模式
- * @default true
- */
- borderless?: boolean;
/**
* 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用
*/
diff --git a/src/message/message.en-US.md b/src/message/message.en-US.md
index fc3e3dc18..efcee543a 100644
--- a/src/message/message.en-US.md
+++ b/src/message/message.en-US.md
@@ -17,24 +17,14 @@ theme | String | info | options:info/success/warning/error。Typescript:`Mes
visible | Boolean | false | `v-model` and `v-model:visible` is supported | N
defaultVisible | Boolean | false | uncontrolled property | N
zIndex | Number | - | \- | N
-onChange | Function | | Typescript:`(visible: boolean) => void`
`deprecated` | N
-onClose | Function | | Typescript:`(context: { trigger: 'close-click' \| 'duration-end', e?: MouseEvent }) => void`
`deprecated`。close message event。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
onCloseBtnClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`
| N
-onClosed | Function | | Typescript:`() => void`
`deprecated` | N
onDurationEnd | Function | | Typescript:`() => void`
| N
-onLinkClick | Function | | 【developing】Typescript:`(context: { e: MouseEvent }) => void`
| N
-onOpen | Function | | Typescript:`() => void`
`deprecated` | N
-onOpened | Function | | Typescript:`() => void`
`deprecated` | N
+onLinkClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`
| N
### Message Events
name | params | description
-- | -- | --
-change | `(visible: boolean)` | `deprecated`
-close | `(context: { trigger: 'close-click' \| 'duration-end', e?: MouseEvent })` | `deprecated`。close message event。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)
close-btn-click | `(context: { e: MouseEvent })` | \-
-closed | \- | `deprecated`
duration-end | \- | \-
-link-click | 【developing】`(context: { e: MouseEvent })` | \-
-open | \- | `deprecated`
-opened | \- | `deprecated`
+link-click | `(context: { e: MouseEvent })` | \-
diff --git a/src/message/message.md b/src/message/message.md
index a5f3c9384..f42061135 100644
--- a/src/message/message.md
+++ b/src/message/message.md
@@ -17,24 +17,14 @@ theme | String | info | 消息组件风格。可选项:info/success/warning/er
visible | Boolean | false | 是否显示,隐藏时默认销毁组件。支持语法糖 `v-model` 或 `v-model:visible` | N
defaultVisible | Boolean | false | 是否显示,隐藏时默认销毁组件。非受控属性 | N
zIndex | Number | - | 元素层级,样式默认为 5000 | N
-onChange | Function | | TS 类型:`(visible: boolean) => void`
已废弃。可见性变化时触发 | N
-onClose | Function | | TS 类型:`(context: { trigger: 'close-click' \| 'duration-end', e?: MouseEvent }) => void`
已废弃。关闭消息时触发。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
onCloseBtnClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`
当关闭按钮存在时,用户点击关闭按钮触发 | N
-onClosed | Function | | TS 类型:`() => void`
已废弃。关闭消息并且动画结束后触发 | N
onDurationEnd | Function | | TS 类型:`() => void`
计时结束后触发 | N
-onLinkClick | Function | | 【开发中】TS 类型:`(context: { e: MouseEvent }) => void`
当link链接存在时,点击链接文本时触发 | N
-onOpen | Function | | TS 类型:`() => void`
已废弃。展示Message时触发 | N
-onOpened | Function | | TS 类型:`() => void`
已废弃。展示Message时并且动画结束后触发 | N
+onLinkClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`
当link链接存在时,点击链接文本时触发 | N
### Message Events
名称 | 参数 | 描述
-- | -- | --
-change | `(visible: boolean)` | 已废弃。可见性变化时触发
-close | `(context: { trigger: 'close-click' \| 'duration-end', e?: MouseEvent })` | 已废弃。关闭消息时触发。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)
close-btn-click | `(context: { e: MouseEvent })` | 当关闭按钮存在时,用户点击关闭按钮触发
-closed | \- | 已废弃。关闭消息并且动画结束后触发
duration-end | \- | 计时结束后触发
-link-click | `(context: { e: MouseEvent })` | 【开发中】当link链接存在时,点击链接文本时触发
-open | \- | 已废弃。展示Message时触发
-opened | \- | 已废弃。展示Message时并且动画结束后触发
+link-click | `(context: { e: MouseEvent })` | 当link链接存在时,点击链接文本时触发
diff --git a/src/message/props.ts b/src/message/props.ts
index 2f7aad8da..099806102 100644
--- a/src/message/props.ts
+++ b/src/message/props.ts
@@ -73,20 +73,10 @@ export default {
zIndex: {
type: Number,
},
- /** 已废弃。可见性变化时触发 */
- onChange: Function as PropType,
- /** 已废弃。关闭消息时触发 */
- onClose: Function as PropType,
/** 当关闭按钮存在时,用户点击关闭按钮触发 */
onCloseBtnClick: Function as PropType,
- /** 已废弃。关闭消息并且动画结束后触发 */
- onClosed: Function as PropType,
/** 计时结束后触发 */
onDurationEnd: Function as PropType,
/** 当link链接存在时,点击链接文本时触发 */
onLinkClick: Function as PropType,
- /** 已废弃。展示Message时触发 */
- onOpen: Function as PropType,
- /** 已废弃。展示Message时并且动画结束后触发 */
- onOpened: Function as PropType,
};
diff --git a/src/message/type.ts b/src/message/type.ts
index 0369c9008..432040844 100644
--- a/src/message/type.ts
+++ b/src/message/type.ts
@@ -67,25 +67,10 @@ export interface TdMessageProps {
* 元素层级,样式默认为 5000
*/
zIndex?: number;
- /**
- * 可见性变化时触发
- * @deprecated
- */
- onChange?: (visible: boolean) => void;
- /**
- * 关闭消息时触发
- * @deprecated
- */
- onClose?: (context: { trigger: 'close-click' | 'duration-end'; e?: MouseEvent }) => void;
/**
* 当关闭按钮存在时,用户点击关闭按钮触发
*/
onCloseBtnClick?: (context: { e: MouseEvent }) => void;
- /**
- * 关闭消息并且动画结束后触发
- * @deprecated
- */
- onClosed?: () => void;
/**
* 计时结束后触发
*/
@@ -94,16 +79,6 @@ export interface TdMessageProps {
* 当link链接存在时,点击链接文本时触发
*/
onLinkClick?: (context: { e: MouseEvent }) => void;
- /**
- * 展示Message时触发
- * @deprecated
- */
- onOpen?: () => void;
- /**
- * 展示Message时并且动画结束后触发
- * @deprecated
- */
- onOpened?: () => void;
}
export type MessageAlignType = 'left' | 'center';
diff --git a/src/radio/props.ts b/src/radio/props.ts
index 268db2523..e6e83ad16 100644
--- a/src/radio/props.ts
+++ b/src/radio/props.ts
@@ -8,15 +8,6 @@ import { TdRadioProps } from './type';
import { PropType } from 'vue';
export default {
- /** 已废弃。复选框和内容相对位置 */
- align: {
- type: String as PropType,
- default: 'left' as TdRadioProps['align'],
- validator(val: TdRadioProps['align']): boolean {
- if (!val) return true;
- return ['left', 'right'].includes(val);
- },
- },
/** 是否允许取消选中 */
allowUncheck: Boolean,
/** 是否为块级元素 */
@@ -82,7 +73,7 @@ export default {
/** 复选框和内容相对位置 */
placement: {
type: String as PropType,
- default: undefined,
+ default: 'left' as TdRadioProps['placement'],
validator(val: TdRadioProps['placement']): boolean {
if (!val) return true;
return ['left', 'right'].includes(val);
diff --git a/src/radio/radio-group-props.ts b/src/radio/radio-group-props.ts
index ef8bc3a54..a1b8e389d 100644
--- a/src/radio/radio-group-props.ts
+++ b/src/radio/radio-group-props.ts
@@ -14,6 +14,11 @@ export default {
borderless: Boolean,
/** 是否禁用全部子单选框。默认为 false。RadioGroup.disabled 优先级低于 Radio.disabled */
disabled: Boolean,
+ /** 自定义选中图标和非选中图标。示例:[选中态图标地址,非选中态图标地址]。使用 String 时,值为 circle 表示填充型图标、值为 line 表示描边型图标、值为 dot 表示圆点图标 */
+ icon: {
+ type: [String, Array] as PropType,
+ default: 'circle',
+ },
/** 用来定义 value / label 在 `options` 中对应的字段别名 */
keys: {
type: Object as PropType,
@@ -23,11 +28,6 @@ export default {
type: String,
default: '',
},
- /** 自定义选中图标和非选中图标。示例:[选中态图标地址,非选中态图标地址]。使用 String 时,值为 circle 表示填充型图标、值为 line 表示描边型图标、值为 dot 表示圆点图标 */
- icon: {
- type: [String, Array] as PropType,
- default: 'circle',
- },
/** 单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同 */
options: {
type: Array as PropType,
diff --git a/src/radio/radio.en-US.md b/src/radio/radio.en-US.md
index 282b96355..3595bf872 100644
--- a/src/radio/radio.en-US.md
+++ b/src/radio/radio.en-US.md
@@ -5,7 +5,6 @@
name | type | default | description | required
-- | -- | -- | -- | --
-align | String | left | options:left/right | N
allowUncheck | Boolean | false | \- | N
block | Boolean | true | \- | N
borderless | Boolean | undefined | \- | N
@@ -20,7 +19,7 @@ label | String / Slot / Function | - | Typescript:`string \| TNode`。[see mor
maxContentRow | Number | 5 | \- | N
maxLabelRow | Number | 3 | \- | N
name | String | - | \- | N
-placement | String | undefined | options:left/right | N
+placement | String | left | options:left/right | N
value | String / Number / Boolean | undefined | Typescript:`string \| number \| boolean` | N
onChange | Function | | Typescript:`(checked: boolean, context: { e: Event }) => void`
| N
@@ -37,9 +36,10 @@ name | type | default | description | required
allowUncheck | Boolean | false | \- | N
borderless | Boolean | false | \- | N
disabled | Boolean | - | \- | N
+icon | String / Array | 'circle' | Typescript:`'circle' \| 'line' \| 'dot' \| Array`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
name | String | - | \- | N
-options | Array | - | Typescript:`Array` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number; disabled?: boolean }`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N
+options | Array | - | Typescript:`Array` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number \| boolean; disabled?: boolean }`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N
placement | String | left | options:left/right | N
value | String / Number / Boolean | - | `v-model` and `v-model:value` is supported。Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N
defaultValue | String / Number / Boolean | - | uncontrolled property。Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N
diff --git a/src/radio/radio.md b/src/radio/radio.md
index 48eb72319..9e38714f9 100644
--- a/src/radio/radio.md
+++ b/src/radio/radio.md
@@ -5,7 +5,6 @@
名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
-align | String | left | 已废弃。复选框和内容相对位置。可选项:left/right | N
allowUncheck | Boolean | false | 是否允许取消选中 | N
block | Boolean | true | 是否为块级元素 | N
borderless | Boolean | undefined | 是否开启无边框模式 | N
@@ -37,9 +36,10 @@ change | `(checked: boolean, context: { e: Event })` | 选中状态变化时触
allowUncheck | Boolean | false | 是否允许取消选中 | N
borderless | Boolean | false | 是否开启无边框模式;优先级低于 Radio | N
disabled | Boolean | - | 是否禁用全部子单选框。默认为 false。RadioGroup.disabled 优先级低于 Radio.disabled | N
+icon | String / Array | 'circle' | 自定义选中图标和非选中图标。示例:[选中态图标地址,非选中态图标地址]。使用 String 时,值为 circle 表示填充型图标、值为 line 表示描边型图标、值为 dot 表示圆点图标。TS 类型:`'circle' \| 'line' \| 'dot' \| Array`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
name | String | - | HTML 元素原生属性 | N
-options | Array | - | 单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同。TS 类型:`Array` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number; disabled?: boolean }`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N
+options | Array | - | 单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同。TS 类型:`Array` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number \| boolean; disabled?: boolean }`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N
placement | String | left | 复选框和内容相对位置。可选项:left/right | N
value | String / Number / Boolean | - | 选中的值。支持语法糖 `v-model` 或 `v-model:value`。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N
defaultValue | String / Number / Boolean | - | 选中的值。非受控属性。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N
diff --git a/src/radio/type.ts b/src/radio/type.ts
index a04dc097b..7d1dbb16f 100644
--- a/src/radio/type.ts
+++ b/src/radio/type.ts
@@ -7,11 +7,6 @@
import { TNode, KeysType } from '../common';
export interface TdRadioProps {
- /**
- * 已废弃。复选框和内容相对位置
- * @default left
- */
- align?: 'left' | 'right';
/**
* 是否允许取消选中
* @default false
@@ -156,7 +151,7 @@ export type RadioOption = string | number | RadioOptionObj;
export interface RadioOptionObj {
label?: string | TNode;
- value?: string | number;
+ value?: string | number | boolean;
disabled?: boolean;
}
diff --git a/src/rate/props.ts b/src/rate/props.ts
index 68b936949..eaffefa50 100644
--- a/src/rate/props.ts
+++ b/src/rate/props.ts
@@ -10,8 +10,6 @@ import { PropType } from 'vue';
export default {
/** 是否允许半选 */
allowHalf: Boolean,
- /** 已废弃。是否允许取消选择 */
- clearable: Boolean,
/** 评分图标的颜色,样式中默认为 #ED7B2F。一个值表示设置选中高亮的五角星颜色,示例:[选中颜色]。数组则表示分别设置 选中高亮的五角星颜色 和 未选中暗灰的五角星颜色,[选中颜色,未选中颜色]。示例:['#ED7B2F', '#E3E6EB']。 */
color: {
type: [String, Array] as PropType,
@@ -31,7 +29,7 @@ export default {
},
/** 自定义评分图标,[选中图标,未选中图标] */
icon: {
- type: [Function, Array] as PropType,
+ type: [Array, Function] as PropType,
},
/** 是否显示对应的辅助文字 */
showText: Boolean,
diff --git a/src/rate/rate.en-US.md b/src/rate/rate.en-US.md
index a8788a95f..e01094f13 100644
--- a/src/rate/rate.en-US.md
+++ b/src/rate/rate.en-US.md
@@ -1,18 +1,16 @@
:: BASE_DOC ::
## API
-
### Rate Props
name | type | default | description | required
-- | -- | -- | -- | --
allowHalf | Boolean | false | \- | N
-clearable | Boolean | false | `deprecated` | N
color | String / Array | '#ED7B2F' | Typescript:`string \| Array` | N
count | Number | 5 | \- | N
disabled | Boolean | - | \- | N
gap | Number | 8 | \- | N
-icon | Array / Slot / Function | - | Typescript:`string \| string[]` | N
+icon | Array / Slot / Function | - | Typescript:`Array`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
showText | Boolean | false | \- | N
size | String | 24px | \- | N
texts | Array | [] | Typescript:`Array` | N
diff --git a/src/rate/rate.md b/src/rate/rate.md
index 75fe99fb9..3e16bf391 100644
--- a/src/rate/rate.md
+++ b/src/rate/rate.md
@@ -6,12 +6,11 @@
名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
allowHalf | Boolean | false | 是否允许半选 | N
-clearable | Boolean | false | 已废弃。是否允许取消选择 | N
color | String / Array | '#ED7B2F' | 评分图标的颜色,样式中默认为 #ED7B2F。一个值表示设置选中高亮的五角星颜色,示例:[选中颜色]。数组则表示分别设置 选中高亮的五角星颜色 和 未选中暗灰的五角星颜色,[选中颜色,未选中颜色]。示例:['#ED7B2F', '#E3E6EB']。。TS 类型:`string \| Array` | N
count | Number | 5 | 评分的数量 | N
disabled | Boolean | - | 是否禁用评分 | N
gap | Number | 8 | 评分图标的间距 | N
-icon | Array / Slot / Function | - | 自定义评分图标,[选中图标,未选中图标]。TS 类型:`string \| string[]` | N
+icon | Array / Slot / Function | - | 自定义评分图标,[选中图标,未选中图标]。TS 类型:`Array`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
showText | Boolean | false | 是否显示对应的辅助文字 | N
size | String | 24px | 评分图标的大小 | N
texts | Array | [] | 评分等级对应的辅助文字。组件内置默认值为:['极差', '失望', '一般', '满意', '惊喜']。自定义值示例:['1分', '2分', '3分', '4分', '5分']。TS 类型:`Array` | N
diff --git a/src/rate/type.ts b/src/rate/type.ts
index 24aa9a1c4..187834310 100644
--- a/src/rate/type.ts
+++ b/src/rate/type.ts
@@ -1,23 +1,17 @@
/* eslint-disable */
-import { TNode } from '@/common';
-
/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */
+import { TNode } from '../common';
+
export interface TdRateProps {
/**
* 是否允许半选
* @default false
*/
allowHalf?: boolean;
- /**
- * 是否允许取消选择
- * @default false
- * @deprecated
- */
- clearable?: boolean;
/**
* 评分图标的颜色,样式中默认为 #ED7B2F。一个值表示设置选中高亮的五角星颜色,示例:[选中颜色]。数组则表示分别设置 选中高亮的五角星颜色 和 未选中暗灰的五角星颜色,[选中颜色,未选中颜色]。示例:['#ED7B2F', '#E3E6EB']。
* @default '#ED7B2F'
diff --git a/src/switch/props.ts b/src/switch/props.ts
index c88f8b1d2..ade77dae2 100644
--- a/src/switch/props.ts
+++ b/src/switch/props.ts
@@ -8,10 +8,6 @@ import { TdSwitchProps } from './type';
import { PropType } from 'vue';
export default {
- /** 已废弃。已废弃。自定义颜色,[打开时的颜色,关闭时的颜色]。组件默认颜色为 ['#0052d9', 'rgba(0, 0, 0, .26']。示例:[blue, gray] */
- colors: {
- type: Array as PropType,
- },
/** 用于自定义开关的值,[打开时的值,关闭时的值]。默认为 [true, false]。示例:[1, 0]、['open', 'close'] */
customValue: {
type: Array as PropType,
diff --git a/src/switch/switch.en-US.md b/src/switch/switch.en-US.md
index 8a22fcb86..ca94f820f 100644
--- a/src/switch/switch.en-US.md
+++ b/src/switch/switch.en-US.md
@@ -5,7 +5,6 @@
name | type | default | description | required
-- | -- | -- | -- | --
-colors | Array | - | `deprecated`。Typescript:`string[]` | N
customValue | Array | - | Typescript:`Array` | N
disabled | Boolean | - | \- | N
icon | Array | [] | Typescript:`TNode[]`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
@@ -14,10 +13,10 @@ loading | Boolean | false | \- | N
size | String | medium | options:small/medium/large | N
value | String / Number / Boolean | - | `v-model` and `v-model:value` is supported。Typescript:`T` `type SwitchValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/switch/type.ts) | N
defaultValue | String / Number / Boolean | - | uncontrolled property。Typescript:`T` `type SwitchValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/switch/type.ts) | N
-onChange | Function | | Typescript:`(value: T) => void`
| N
+onChange | Function | | Typescript:`(value: T, context: { e: MouseEvent }) => void`
| N
### Switch Events
name | params | description
-- | -- | --
-change | `(value: T)` | \-
+change | `(value: T, context: { e: MouseEvent })` | \-
diff --git a/src/switch/switch.md b/src/switch/switch.md
index 1acd903ae..099315cf0 100644
--- a/src/switch/switch.md
+++ b/src/switch/switch.md
@@ -5,7 +5,6 @@
名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
-colors | Array | - | 已废弃。已废弃。自定义颜色,[打开时的颜色,关闭时的颜色]。组件默认颜色为 ['#0052d9', 'rgba(0, 0, 0, .26']。示例:[blue, gray]。TS 类型:`string[]` | N
customValue | Array | - | 用于自定义开关的值,[打开时的值,关闭时的值]。默认为 [true, false]。示例:[1, 0]、['open', 'close']。TS 类型:`Array` | N
disabled | Boolean | - | 是否禁用组件,默认为 false | N
icon | Array | [] | 开关的图标;[打开时的图标,关闭时的图标]。TS 类型:`TNode[]`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
@@ -14,10 +13,10 @@ loading | Boolean | false | 是否处于加载中状态 | N
size | String | medium | 开关尺寸。可选项:small/medium/large | N
value | String / Number / Boolean | - | 开关值。支持语法糖 `v-model` 或 `v-model:value`。TS 类型:`T` `type SwitchValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/switch/type.ts) | N
defaultValue | String / Number / Boolean | - | 开关值。非受控属性。TS 类型:`T` `type SwitchValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/switch/type.ts) | N
-onChange | Function | | TS 类型:`(value: T) => void`
数据发生变化时触发 | N
+onChange | Function | | TS 类型:`(value: T, context: { e: MouseEvent }) => void`
数据发生变化时触发 | N
### Switch Events
名称 | 参数 | 描述
-- | -- | --
-change | `(value: T)` | 数据发生变化时触发
+change | `(value: T, context: { e: MouseEvent })` | 数据发生变化时触发
diff --git a/src/switch/type.ts b/src/switch/type.ts
index f48c2a45e..e83495c86 100644
--- a/src/switch/type.ts
+++ b/src/switch/type.ts
@@ -7,11 +7,6 @@
import { TNode } from '../common';
export interface TdSwitchProps {
- /**
- * 已废弃。自定义颜色,[打开时的颜色,关闭时的颜色]。组件默认颜色为 ['#0052d9', 'rgba(0, 0, 0, .26']。示例:[blue, gray]
- * @deprecated
- */
- colors?: string[];
/**
* 用于自定义开关的值,[打开时的值,关闭时的值]。默认为 [true, false]。示例:[1, 0]、['open', 'close']
*/
@@ -55,7 +50,7 @@ export interface TdSwitchProps {
/**
* 数据发生变化时触发
*/
- onChange?: (value: T) => void;
+ onChange?: (value: T, context: { e: MouseEvent }) => void;
}
export type SwitchValue = string | number | boolean;
diff --git a/src/tabs/props.ts b/src/tabs/props.ts
index afe410ce1..8c2568f92 100644
--- a/src/tabs/props.ts
+++ b/src/tabs/props.ts
@@ -16,15 +16,6 @@ export default {
list: {
type: Array as PropType,
},
- /** 已废弃。选项卡位置 */
- placement: {
- type: String as PropType,
- default: 'top' as TdTabsProps['placement'],
- validator(val: TdTabsProps['placement']): boolean {
- if (!val) return true;
- return ['left', 'top'].includes(val);
- },
- },
/** 是否展示底部激活线条 */
showBottomLine: {
type: Boolean,
diff --git a/src/tabs/tabs.en-US.md b/src/tabs/tabs.en-US.md
index ddba604dc..0427cf9b9 100644
--- a/src/tabs/tabs.en-US.md
+++ b/src/tabs/tabs.en-US.md
@@ -1,14 +1,12 @@
:: BASE_DOC ::
## API
-
### Tabs Props
name | type | default | description | required
-- | -- | -- | -- | --
animation | Object | - | Typescript:`TabAnimation` `type TabAnimation = { duration: number } & Record`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/tabs/type.ts) | N
list | Array | - | Typescript:`Array` | N
-placement | String | top | options:left/top | N
showBottomLine | Boolean | true | \- | N
size | String | medium | options:medium/large | N
spaceEvenly | Boolean | true | \- | N
diff --git a/src/tabs/tabs.md b/src/tabs/tabs.md
index 63f647ec2..1a4cc9da0 100644
--- a/src/tabs/tabs.md
+++ b/src/tabs/tabs.md
@@ -7,7 +7,6 @@
-- | -- | -- | -- | --
animation | Object | - | 动画效果设置。其中 duration 表示动画时长。TS 类型:`TabAnimation` `type TabAnimation = { duration: number } & Record`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/tabs/type.ts) | N
list | Array | - | 选项卡列表。TS 类型:`Array` | N
-placement | String | top | 已废弃。选项卡位置。可选项:left/top | N
showBottomLine | Boolean | true | 是否展示底部激活线条 | N
size | String | medium | 组件尺寸。可选项:medium/large | N
spaceEvenly | Boolean | true | 选项卡头部空间是否均分 | N
diff --git a/src/tabs/type.ts b/src/tabs/type.ts
index eb3363843..a56fe2d5a 100644
--- a/src/tabs/type.ts
+++ b/src/tabs/type.ts
@@ -16,11 +16,6 @@ export interface TdTabsProps {
* 选项卡列表
*/
list?: Array;
- /**
- * 已废弃。选项卡位置
- * @default top
- */
- placement?: 'left' | 'top';
/**
* 是否展示底部激活线条
* @default true