diff --git a/db/TDesign.db b/db/TDesign.db index e0e167b2a..613ae2f74 100644 Binary files a/db/TDesign.db and b/db/TDesign.db differ diff --git a/packages/products/tdesign-mobile-vue/src/notice-bar/notice-bar.en-US.md b/packages/products/tdesign-mobile-vue/src/notice-bar/notice-bar.en-US.md index 0def8a2c0..b8937681c 100644 --- a/packages/products/tdesign-mobile-vue/src/notice-bar/notice-bar.en-US.md +++ b/packages/products/tdesign-mobile-vue/src/notice-bar/notice-bar.en-US.md @@ -8,6 +8,7 @@ name | type | default | description | required -- | -- | -- | -- | -- content | String / Array / Slot / Function | - | Typescript:`string \| string[] \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N direction | String | horizontal | options: horizontal/vertical | N +interval | Number | 2000 | \- | N marquee | Boolean / Object | false | Typescript:`boolean \| NoticeBarMarquee` `interface NoticeBarMarquee { speed?: number; loop?: number; delay?: number }`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/notice-bar/type.ts) | N operation | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N prefixIcon | Boolean / Slot / Function | true | Typescript:`Boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N @@ -15,10 +16,12 @@ suffixIcon | Slot / Function | - | Typescript:`TNode`。[see more ts definitio theme | String | info | options: info/success/warning/error | N visible | Boolean | false | `v-model` and `v-model:visible` is supported | N defaultVisible | Boolean | false | uncontrolled property | N +onChange | Function | | Typescript:`(current: number, source: '' \| 'autoplay' \| 'touch') => void`
| N onClick | Function | | Typescript:`(trigger: NoticeBarTrigger) => void`
[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/notice-bar/type.ts)。
`type NoticeBarTrigger = 'prefix-icon' \| 'content' \| 'operation' \| 'suffix-icon';`
| N ### NoticeBar Events name | params | description -- | -- | -- +change | `(current: number, source: '' \| 'autoplay' \| 'touch')` | \- click | `(trigger: NoticeBarTrigger)` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/notice-bar/type.ts)。
`type NoticeBarTrigger = 'prefix-icon' \| 'content' \| 'operation' \| 'suffix-icon';`
diff --git a/packages/products/tdesign-mobile-vue/src/notice-bar/notice-bar.md b/packages/products/tdesign-mobile-vue/src/notice-bar/notice-bar.md index 154c375d4..ab6940165 100644 --- a/packages/products/tdesign-mobile-vue/src/notice-bar/notice-bar.md +++ b/packages/products/tdesign-mobile-vue/src/notice-bar/notice-bar.md @@ -8,6 +8,7 @@ -- | -- | -- | -- | -- content | String / Array / Slot / Function | - | 文本内容。TS 类型:`string \| string[] \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N direction | String | horizontal | 滚动方向。可选项:horizontal/vertical | N +interval | Number | 2000 | 间隔时间【仅在 direction='vertical' 有效】 | N marquee | Boolean / Object | false | 跑马灯效果。speed 指速度控制;loop 指循环播放次数,值为 -1 表示循环播放,值为 0 表示不循环播放;delay 表示延迟多久开始播放。TS 类型:`boolean \| NoticeBarMarquee` `interface NoticeBarMarquee { speed?: number; loop?: number; delay?: number }`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/notice-bar/type.ts) | N operation | String / Slot / Function | - | 右侧额外信息。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N prefixIcon | Boolean / Slot / Function | true | 用于自定义公告栏前面的图标,优先级大于 theme 设定的图标。值为 false 则不显示图标,值为 true 显示 theme 设定图标。TS 类型:`Boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N @@ -15,10 +16,12 @@ suffixIcon | Slot / Function | - | 后缀图标。TS 类型:`TNode`。[通用 theme | String | info | 内置主题。可选项:info/success/warning/error | N visible | Boolean | false | 显示/隐藏。支持语法糖 `v-model` 或 `v-model:visible` | N defaultVisible | Boolean | false | 显示/隐藏。非受控属性 | N +onChange | Function | | TS 类型:`(current: number, source: '' \| 'autoplay' \| 'touch') => void`
当 `direction="vertical"` 时轮播切换时触发 | N onClick | Function | | TS 类型:`(trigger: NoticeBarTrigger) => void`
点击事件。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/notice-bar/type.ts)。
`type NoticeBarTrigger = 'prefix-icon' \| 'content' \| 'operation' \| 'suffix-icon';`
| N ### NoticeBar Events 名称 | 参数 | 描述 -- | -- | -- +change | `(current: number, source: '' \| 'autoplay' \| 'touch')` | 当 `direction="vertical"` 时轮播切换时触发 click | `(trigger: NoticeBarTrigger)` | 点击事件。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/notice-bar/type.ts)。
`type NoticeBarTrigger = 'prefix-icon' \| 'content' \| 'operation' \| 'suffix-icon';`
diff --git a/packages/products/tdesign-mobile-vue/src/notice-bar/props.ts b/packages/products/tdesign-mobile-vue/src/notice-bar/props.ts index 86c38c51e..b20910cd2 100644 --- a/packages/products/tdesign-mobile-vue/src/notice-bar/props.ts +++ b/packages/products/tdesign-mobile-vue/src/notice-bar/props.ts @@ -21,6 +21,11 @@ export default { return ['horizontal', 'vertical'].includes(val); }, }, + /** 间隔时间【仅在 direction='vertical' 有效】 */ + interval: { + type: Number, + default: 2000, + }, /** 跑马灯效果。speed 指速度控制;loop 指循环播放次数,值为 -1 表示循环播放,值为 0 表示不循环播放;delay 表示延迟多久开始播放 */ marquee: { type: [Boolean, Object] as PropType, @@ -59,6 +64,8 @@ export default { }, /** 显示/隐藏,非受控属性 */ defaultVisible: Boolean, + /** 当 `direction="vertical"` 时轮播切换时触发 */ + onChange: Function as PropType, /** 点击事件 */ onClick: Function as PropType, }; diff --git a/packages/products/tdesign-mobile-vue/src/notice-bar/type.ts b/packages/products/tdesign-mobile-vue/src/notice-bar/type.ts index 9ccb51d8b..2f778d36d 100644 --- a/packages/products/tdesign-mobile-vue/src/notice-bar/type.ts +++ b/packages/products/tdesign-mobile-vue/src/notice-bar/type.ts @@ -16,6 +16,11 @@ export interface TdNoticeBarProps { * @default horizontal */ direction?: 'horizontal' | 'vertical'; + /** + * 间隔时间【仅在 direction='vertical' 有效】 + * @default 2000 + */ + interval?: number; /** * 跑马灯效果。speed 指速度控制;loop 指循环播放次数,值为 -1 表示循环播放,值为 0 表示不循环播放;delay 表示延迟多久开始播放 * @default false @@ -54,6 +59,10 @@ export interface TdNoticeBarProps { * @default false */ modelValue?: boolean; + /** + * 当 `direction="vertical"` 时轮播切换时触发 + */ + onChange?: (current: number, source: '' | 'autoplay' | 'touch') => void; /** * 点击事件 */ diff --git a/packages/scripts/api.json b/packages/scripts/api.json index ac26d6898..c2e787fbf 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -75759,6 +75759,7 @@ { "id": 1712057349, "platform_framework": [ + "8", "64" ], "component": "NoticeBar", @@ -75777,7 +75778,7 @@ "update_time": "2024-04-02 11:29:09", "event_output": null, "custom_field_type": null, - "syntactic_sugar": null, + "syntactic_sugar": "", "readonly": 1, "html_attribute": 0, "trigger_elements": "", @@ -75787,6 +75788,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(Mobile)", "Miniprogram" ], "field_type_text": [ @@ -76247,6 +76249,7 @@ { "id": 1712057632, "platform_framework": [ + "8", "64" ], "component": "NoticeBar", @@ -76263,7 +76266,7 @@ "update_time": "2024-04-02 11:33:52", "event_output": null, "custom_field_type": null, - "syntactic_sugar": null, + "syntactic_sugar": "", "readonly": 1, "html_attribute": 0, "trigger_elements": "", @@ -76273,6 +76276,7 @@ "support_default_value": 0, "field_category_text": "Events", "platform_framework_text": [ + "Vue(Mobile)", "Miniprogram" ], "field_type_text": []