From bd1f071f744e7cd46132202361865dd900454ca0 Mon Sep 17 00:00:00 2001 From: HaixingOoO <974758671@qq.com> Date: Sun, 2 Aug 2026 14:39:59 +0800 Subject: [PATCH] feat(Scrollbar): new add Scrollbar api --- db/TDesign.db | Bin 1150976 -> 1159168 bytes .../components/scrollbar/defaultProps.ts | 14 + .../components/scrollbar/scrollbar.en-US.md | 34 + .../components/scrollbar/scrollbar.md | 34 + .../packages/components/scrollbar/type.ts | 108 +++ .../packages/components/scrollbar/props.ts | 73 ++ .../components/scrollbar/scrollbar.en-US.md | 36 + .../components/scrollbar/scrollbar.md | 36 + .../packages/components/scrollbar/type.ts | 108 +++ .../tdesign-vue/src/scrollbar/props.ts | 73 ++ .../src/scrollbar/scrollbar.en-US.md | 36 + .../tdesign-vue/src/scrollbar/scrollbar.md | 36 + .../tdesign-vue/src/scrollbar/type.ts | 108 +++ packages/scripts/api.json | 864 ++++++++++++++++++ packages/scripts/map.json | 4 + .../server/controllers/ComponentApi/const.ts | 1 + 16 files changed, 1565 insertions(+) create mode 100644 packages/products/tdesign-react/packages/components/scrollbar/defaultProps.ts create mode 100644 packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md create mode 100644 packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md create mode 100644 packages/products/tdesign-react/packages/components/scrollbar/type.ts create mode 100644 packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts create mode 100644 packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md create mode 100644 packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md create mode 100644 packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts create mode 100644 packages/products/tdesign-vue/src/scrollbar/props.ts create mode 100644 packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md create mode 100644 packages/products/tdesign-vue/src/scrollbar/scrollbar.md create mode 100644 packages/products/tdesign-vue/src/scrollbar/type.ts diff --git a/db/TDesign.db b/db/TDesign.db index b3394ecc704fe2908464ddd4a9a4dc1b0c6f88da..c2ecea0ae94a702823cd839b0eeb0f8ce6350e4d 100644 GIT binary patch delta 5750 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 void`
Triggered while scrolling | N + +### ScrollbarInstanceFunctions 组件实例方法 + +name | params | return | description +-- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N +getValues | \- | `PositionValues ` | required。Get the view object containing complete scrolling information。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | required。Scroll to a specific set of coordinates。Typescript: `ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | required。Scroll to one side。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md new file mode 100644 index 000000000..d2bfaf72c --- /dev/null +++ b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md @@ -0,0 +1,34 @@ +:: BASE_DOC :: + +## API + +### Scrollbar Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +ariaLabel | String | - | 视图层的 aria-label 文本 | N +autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N +container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N +disabled | Boolean | false | 禁止滚动 | N +id | String | - | 视图层的 ID | N +noResize | Boolean | false | 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) | N +role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N +step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N +tabindex | String / Number | - | 包裹容器的 tabindex | N +thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N +viewClass | String | - | 视图(内容区)的自定义类名 | N +visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N +wrapClass | String | - | 包裹容器的自定义类名 | N +onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N + +### ScrollbarInstanceFunctions 组件实例方法 + +名称 | 参数 | 返回值 | 描述 +-- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +getValues | \- | `PositionValues ` | 必需。获取包含完整滚动信息的视图对象。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | 必需。滚动到一组特定坐标。TS 类型:`ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | 必需。滚动到某一边。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-react/packages/components/scrollbar/type.ts b/packages/products/tdesign-react/packages/components/scrollbar/type.ts new file mode 100644 index 000000000..bab94ddd7 --- /dev/null +++ b/packages/products/tdesign-react/packages/components/scrollbar/type.ts @@ -0,0 +1,108 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +export interface TdScrollbarProps { + /** + * 视图层的 aria-label 文本 + * @default '' + */ + ariaLabel?: string; + /** + * 滚动条 hover 时是否向外扩展(增加交互热区) + * @default true + */ + autoExpand?: boolean; + /** + * 设置滚动容器的最大高度/宽度 + */ + container?: ScrollbarContainerProps; + /** + * 禁止滚动 + * @default false + */ + disabled?: boolean; + /** + * 视图层的 ID + * @default '' + */ + id?: string; + /** + * 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) + * @default false + */ + noResize?: boolean; + /** + * 视图层的 WAI-ARIA 角色 + * @default scrollbar + */ + role?: string; + /** + * 滚动步长 + */ + step?: { x?: number; y?: number }; + /** + * 包裹容器的 tabindex + */ + tabindex?: string | number; + /** + * 滚动条滑块的最小尺寸(px) + * @default 20 + */ + thumbMinSize?: number; + /** + * 视图(内容区)的自定义类名 + * @default '' + */ + viewClass?: string; + /** + * 滚动条的显示形式 + * @default hover + */ + visibility?: 'always' | 'hover' | 'hide'; + /** + * 包裹容器的自定义类名 + * @default '' + */ + wrapClass?: string; + /** + * 滚动时触发 + */ + onScroll?: (context: { e: Event }) => void; +} + +/** 组件实例方法 */ +export interface ScrollbarInstanceFunctions { + /** + * 获取包含完整滚动信息的视图对象 + */ + getValues: () => PositionValues; + /** + * 滚动到一组特定坐标 + */ + scrollTo: (options: { top?: number; left?: number; behavior?: ScrollBehavior }) => void; + /** + * 滚动到某一边 + */ + scrollToEdge: (position: PositionEdge) => void; +} + +export interface PositionValues { + left: number; + top: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; + scrollHeight: number; + clientWidth: number; + clientHeight: number; +} + +export type ScrollToFn = { + (x: number, y: number): void; + (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; +}; + +export type PositionEdge = 'left' | 'right' | 'top' | 'bottom'; diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts b/packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts new file mode 100644 index 000000000..363ce51aa --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts @@ -0,0 +1,73 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdScrollbarProps } from './type'; +import { PropType } from 'vue'; + +export default { + /** 视图层的 aria-label 文本 */ + ariaLabel: { + type: String, + default: '', + }, + /** 滚动条 hover 时是否向外扩展(增加交互热区) */ + autoExpand: { + type: Boolean, + default: true, + }, + /** 设置滚动容器的最大高度/宽度 */ + container: { + type: Object as PropType, + }, + /** 禁止滚动 */ + disabled: Boolean, + /** 视图层的 ID */ + id: { + type: String, + default: '', + }, + /** 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) */ + noResize: Boolean, + /** 视图层的 WAI-ARIA 角色 */ + role: { + type: String, + default: 'scrollbar', + }, + /** 滚动步长 */ + step: { + type: Object as PropType, + }, + /** 包裹容器的 tabindex */ + tabindex: { + type: [String, Number] as PropType, + }, + /** 滚动条滑块的最小尺寸(px) */ + thumbMinSize: { + type: Number, + default: 20, + }, + /** 视图(内容区)的自定义类名 */ + viewClass: { + type: String, + default: '', + }, + /** 滚动条的显示形式 */ + visibility: { + type: String as PropType, + default: 'hover' as TdScrollbarProps['visibility'], + validator(val: TdScrollbarProps['visibility']): boolean { + if (!val) return true; + return ['always', 'hover', 'hide'].includes(val); + }, + }, + /** 包裹容器的自定义类名 */ + wrapClass: { + type: String, + default: '', + }, + /** 滚动时触发 */ + onScroll: Function as PropType, +}; diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md new file mode 100644 index 000000000..d5c13a0fd --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md @@ -0,0 +1,36 @@ +:: BASE_DOC :: + +## API + +### Scrollbar Props + +name | type | default | description | required +-- | -- | -- | -- | -- +ariaLabel | String | - | aria-label text in view layer | N +autoExpand | Boolean | true | Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)? | N +container | Object | - | Set the maximum height/width of the scrolling container.。Typescript: `ScrollbarContainerProps` | N +disabled | Boolean | false | disabled scroll | N +id | String | - | ID of the view layer | N +noResize | Boolean | false | Does the container size respond to changes? (If the container size is constant, enabling this feature can optimize performance.) | N +role | String | scrollbar | WAI-ARIA role in the view layer | N +step | Object | - | Rolling step。Typescript: `{x?:number;y?:number}` | N +tabindex | String / Number | - | tabindex of the container | N +thumbMinSize | Number | 20 | Minimum size (px) of the scroll bar slider. | N +viewClass | String | - | Custom class name for the view (content area) | N +visibility | String | hover | Scroll bar display format。options: always/hover/hide | N +wrapClass | String | - | Custom class name of the wrapper container | N +onScroll | Function | | Typescript: `(context:{e:Event}) => void`
Triggered while scrolling | N + +### Scrollbar Events + +name | params | description +-- | -- | -- +scroll | `(context:{e:Event})` | Triggered while scrolling + +### ScrollbarInstanceFunctions 组件实例方法 + +name | params | return | description +-- | -- | -- | -- +getValues | \- | `PositionValues ` | required。Get the view object containing complete scrolling information。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | required。Scroll to a specific set of coordinates。Typescript: `ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | required。Scroll to one side。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md new file mode 100644 index 000000000..cb19bbb70 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md @@ -0,0 +1,36 @@ +:: BASE_DOC :: + +## API + +### Scrollbar Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +ariaLabel | String | - | 视图层的 aria-label 文本 | N +autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N +container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N +disabled | Boolean | false | 禁止滚动 | N +id | String | - | 视图层的 ID | N +noResize | Boolean | false | 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) | N +role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N +step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N +tabindex | String / Number | - | 包裹容器的 tabindex | N +thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N +viewClass | String | - | 视图(内容区)的自定义类名 | N +visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N +wrapClass | String | - | 包裹容器的自定义类名 | N +onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N + +### Scrollbar Events + +名称 | 参数 | 描述 +-- | -- | -- +scroll | `(context:{e:Event})` | 滚动时触发 + +### ScrollbarInstanceFunctions 组件实例方法 + +名称 | 参数 | 返回值 | 描述 +-- | -- | -- | -- +getValues | \- | `PositionValues ` | 必需。获取包含完整滚动信息的视图对象。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | 必需。滚动到一组特定坐标。TS 类型:`ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | 必需。滚动到某一边。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts b/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts new file mode 100644 index 000000000..bab94ddd7 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts @@ -0,0 +1,108 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +export interface TdScrollbarProps { + /** + * 视图层的 aria-label 文本 + * @default '' + */ + ariaLabel?: string; + /** + * 滚动条 hover 时是否向外扩展(增加交互热区) + * @default true + */ + autoExpand?: boolean; + /** + * 设置滚动容器的最大高度/宽度 + */ + container?: ScrollbarContainerProps; + /** + * 禁止滚动 + * @default false + */ + disabled?: boolean; + /** + * 视图层的 ID + * @default '' + */ + id?: string; + /** + * 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) + * @default false + */ + noResize?: boolean; + /** + * 视图层的 WAI-ARIA 角色 + * @default scrollbar + */ + role?: string; + /** + * 滚动步长 + */ + step?: { x?: number; y?: number }; + /** + * 包裹容器的 tabindex + */ + tabindex?: string | number; + /** + * 滚动条滑块的最小尺寸(px) + * @default 20 + */ + thumbMinSize?: number; + /** + * 视图(内容区)的自定义类名 + * @default '' + */ + viewClass?: string; + /** + * 滚动条的显示形式 + * @default hover + */ + visibility?: 'always' | 'hover' | 'hide'; + /** + * 包裹容器的自定义类名 + * @default '' + */ + wrapClass?: string; + /** + * 滚动时触发 + */ + onScroll?: (context: { e: Event }) => void; +} + +/** 组件实例方法 */ +export interface ScrollbarInstanceFunctions { + /** + * 获取包含完整滚动信息的视图对象 + */ + getValues: () => PositionValues; + /** + * 滚动到一组特定坐标 + */ + scrollTo: (options: { top?: number; left?: number; behavior?: ScrollBehavior }) => void; + /** + * 滚动到某一边 + */ + scrollToEdge: (position: PositionEdge) => void; +} + +export interface PositionValues { + left: number; + top: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; + scrollHeight: number; + clientWidth: number; + clientHeight: number; +} + +export type ScrollToFn = { + (x: number, y: number): void; + (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; +}; + +export type PositionEdge = 'left' | 'right' | 'top' | 'bottom'; diff --git a/packages/products/tdesign-vue/src/scrollbar/props.ts b/packages/products/tdesign-vue/src/scrollbar/props.ts new file mode 100644 index 000000000..363ce51aa --- /dev/null +++ b/packages/products/tdesign-vue/src/scrollbar/props.ts @@ -0,0 +1,73 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdScrollbarProps } from './type'; +import { PropType } from 'vue'; + +export default { + /** 视图层的 aria-label 文本 */ + ariaLabel: { + type: String, + default: '', + }, + /** 滚动条 hover 时是否向外扩展(增加交互热区) */ + autoExpand: { + type: Boolean, + default: true, + }, + /** 设置滚动容器的最大高度/宽度 */ + container: { + type: Object as PropType, + }, + /** 禁止滚动 */ + disabled: Boolean, + /** 视图层的 ID */ + id: { + type: String, + default: '', + }, + /** 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) */ + noResize: Boolean, + /** 视图层的 WAI-ARIA 角色 */ + role: { + type: String, + default: 'scrollbar', + }, + /** 滚动步长 */ + step: { + type: Object as PropType, + }, + /** 包裹容器的 tabindex */ + tabindex: { + type: [String, Number] as PropType, + }, + /** 滚动条滑块的最小尺寸(px) */ + thumbMinSize: { + type: Number, + default: 20, + }, + /** 视图(内容区)的自定义类名 */ + viewClass: { + type: String, + default: '', + }, + /** 滚动条的显示形式 */ + visibility: { + type: String as PropType, + default: 'hover' as TdScrollbarProps['visibility'], + validator(val: TdScrollbarProps['visibility']): boolean { + if (!val) return true; + return ['always', 'hover', 'hide'].includes(val); + }, + }, + /** 包裹容器的自定义类名 */ + wrapClass: { + type: String, + default: '', + }, + /** 滚动时触发 */ + onScroll: Function as PropType, +}; diff --git a/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md new file mode 100644 index 000000000..10368ab88 --- /dev/null +++ b/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md @@ -0,0 +1,36 @@ +:: BASE_DOC :: + +## API + +### Scrollbar Props + +name | type | default | description | required +-- | -- | -- | -- | -- +ariaLabel | String | - | aria-label text in view layer | N +autoExpand | Boolean | true | Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)? | N +container | Object | - | Set the maximum height/width of the scrolling container.。Typescript: `ScrollbarContainerProps` | N +disabled | Boolean | false | disabled scroll | N +id | String | - | ID of the view layer | N +noResize | Boolean | false | Does the container size respond to changes? (If the container size is constant, enabling this feature can optimize performance.) | N +role | String | scrollbar | WAI-ARIA role in the view layer | N +step | Object | - | Rolling step。Typescript: `{x?:number;y?:number}` | N +tabindex | String / Number | - | tabindex of the container | N +thumbMinSize | Number | 20 | Minimum size (px) of the scroll bar slider. | N +viewClass | String | - | Custom class name for the view (content area) | N +visibility | String | hover | Scroll bar display format。options: always/hover/hide | N +wrapClass | String | - | Custom class name of the wrapper container | N +onScroll | Function | | Typescript: `(context:{e:Event}) => void`
Triggered while scrolling | N + +### Scrollbar Events + +name | params | description +-- | -- | -- +scroll | `(context:{e:Event})` | Triggered while scrolling + +### ScrollbarInstanceFunctions 组件实例方法 + +name | params | return | description +-- | -- | -- | -- +getValues | \- | `PositionValues ` | required。Get the view object containing complete scrolling information。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | required。Scroll to a specific set of coordinates。Typescript: `ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | required。Scroll to one side。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue/src/scrollbar/scrollbar.md b/packages/products/tdesign-vue/src/scrollbar/scrollbar.md new file mode 100644 index 000000000..353d5ad2b --- /dev/null +++ b/packages/products/tdesign-vue/src/scrollbar/scrollbar.md @@ -0,0 +1,36 @@ +:: BASE_DOC :: + +## API + +### Scrollbar Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +ariaLabel | String | - | 视图层的 aria-label 文本 | N +autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N +container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N +disabled | Boolean | false | 禁止滚动 | N +id | String | - | 视图层的 ID | N +noResize | Boolean | false | 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) | N +role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N +step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N +tabindex | String / Number | - | 包裹容器的 tabindex | N +thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N +viewClass | String | - | 视图(内容区)的自定义类名 | N +visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N +wrapClass | String | - | 包裹容器的自定义类名 | N +onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N + +### Scrollbar Events + +名称 | 参数 | 描述 +-- | -- | -- +scroll | `(context:{e:Event})` | 滚动时触发 + +### ScrollbarInstanceFunctions 组件实例方法 + +名称 | 参数 | 返回值 | 描述 +-- | -- | -- | -- +getValues | \- | `PositionValues ` | 必需。获取包含完整滚动信息的视图对象。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | 必需。滚动到一组特定坐标。TS 类型:`ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | 必需。滚动到某一边。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue/src/scrollbar/type.ts b/packages/products/tdesign-vue/src/scrollbar/type.ts new file mode 100644 index 000000000..bab94ddd7 --- /dev/null +++ b/packages/products/tdesign-vue/src/scrollbar/type.ts @@ -0,0 +1,108 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +export interface TdScrollbarProps { + /** + * 视图层的 aria-label 文本 + * @default '' + */ + ariaLabel?: string; + /** + * 滚动条 hover 时是否向外扩展(增加交互热区) + * @default true + */ + autoExpand?: boolean; + /** + * 设置滚动容器的最大高度/宽度 + */ + container?: ScrollbarContainerProps; + /** + * 禁止滚动 + * @default false + */ + disabled?: boolean; + /** + * 视图层的 ID + * @default '' + */ + id?: string; + /** + * 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) + * @default false + */ + noResize?: boolean; + /** + * 视图层的 WAI-ARIA 角色 + * @default scrollbar + */ + role?: string; + /** + * 滚动步长 + */ + step?: { x?: number; y?: number }; + /** + * 包裹容器的 tabindex + */ + tabindex?: string | number; + /** + * 滚动条滑块的最小尺寸(px) + * @default 20 + */ + thumbMinSize?: number; + /** + * 视图(内容区)的自定义类名 + * @default '' + */ + viewClass?: string; + /** + * 滚动条的显示形式 + * @default hover + */ + visibility?: 'always' | 'hover' | 'hide'; + /** + * 包裹容器的自定义类名 + * @default '' + */ + wrapClass?: string; + /** + * 滚动时触发 + */ + onScroll?: (context: { e: Event }) => void; +} + +/** 组件实例方法 */ +export interface ScrollbarInstanceFunctions { + /** + * 获取包含完整滚动信息的视图对象 + */ + getValues: () => PositionValues; + /** + * 滚动到一组特定坐标 + */ + scrollTo: (options: { top?: number; left?: number; behavior?: ScrollBehavior }) => void; + /** + * 滚动到某一边 + */ + scrollToEdge: (position: PositionEdge) => void; +} + +export interface PositionValues { + left: number; + top: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; + scrollHeight: number; + clientWidth: number; + clientHeight: number; +} + +export type ScrollToFn = { + (x: number, y: number): void; + (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; +}; + +export type PositionEdge = 'left' | 'right' | 'top' | 'bottom'; diff --git a/packages/scripts/api.json b/packages/scripts/api.json index bb0551ec5..9e58cfebd 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -109894,6 +109894,870 @@ ], "field_type_text": [] }, + { + "id": 1785643138, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "ariaLabel", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "视图层的 aria-label 文本", + "field_desc_en": "aria-label text in view layer", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:58:58", + "update_time": "2026-08-02 03:58:58", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642956, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "autoExpand", + "field_type": [ + "4" + ], + "field_default_value": "true", + "field_enum": "", + "field_desc_zh": "滚动条 hover 时是否向外扩展(增加交互热区)", + "field_desc_en": "Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)?", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:55:56", + "update_time": "2026-08-02 03:55:56", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Boolean" + ] + }, + { + "id": 1785642550, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "container", + "field_type": [ + "8" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "设置滚动容器的最大高度/宽度", + "field_desc_en": "Set the maximum height/width of the scrolling container.", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:49:10", + "update_time": "2026-08-02 03:49:10", + "event_output": null, + "custom_field_type": "ScrollbarContainerProps", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Object" + ] + }, + { + "id": 1785642610, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "disabled", + "field_type": [ + "4" + ], + "field_default_value": "false", + "field_enum": "", + "field_desc_zh": "禁止滚动", + "field_desc_en": "disabled scroll", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:50:10", + "update_time": "2026-08-02 03:50:10", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Boolean" + ] + }, + { + "id": 1785643082, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "id", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "视图层的 ID", + "field_desc_en": "ID of the view layer", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:58:02", + "update_time": "2026-08-02 03:58:02", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642246, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "noResize", + "field_type": [ + "4" + ], + "field_default_value": "false", + "field_enum": "", + "field_desc_zh": "容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能)", + "field_desc_en": "Does the container size respond to changes? (If the container size is constant, enabling this feature can optimize performance.)", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:44:06", + "update_time": "2026-08-02 03:44:06", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Boolean" + ] + }, + { + "id": 1785643111, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "role", + "field_type": [ + "1" + ], + "field_default_value": "scrollbar", + "field_enum": "", + "field_desc_zh": "视图层的 WAI-ARIA 角色", + "field_desc_en": "WAI-ARIA role in the view layer", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:58:31", + "update_time": "2026-08-02 03:58:31", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642680, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "step", + "field_type": [ + "8" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "滚动步长", + "field_desc_en": "Rolling step", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:51:20", + "update_time": "2026-08-02 03:51:20", + "event_output": null, + "custom_field_type": "{x?:number;y?:number}", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Object" + ] + }, + { + "id": 1785643171, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "tabindex", + "field_type": [ + "1", + "2" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "包裹容器的 tabindex", + "field_desc_en": "tabindex of the container", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:59:31", + "update_time": "2026-08-02 03:59:31", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String", + "Number" + ] + }, + { + "id": 1785642391, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "thumbMinSize", + "field_type": [ + "2" + ], + "field_default_value": "20", + "field_enum": "", + "field_desc_zh": "滚动条滑块的最小尺寸(px)", + "field_desc_en": "Minimum size (px) of the scroll bar slider.", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:46:31", + "update_time": "2026-08-02 03:46:31", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Number" + ] + }, + { + "id": 1785642840, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "viewClass", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "视图(内容区)的自定义类名", + "field_desc_en": "Custom class name for the view (content area)", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:54:00", + "update_time": "2026-08-02 03:54:00", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642898, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "visibility", + "field_type": [ + "1" + ], + "field_default_value": "hover", + "field_enum": "always/hover/hide", + "field_desc_zh": "滚动条的显示形式", + "field_desc_en": "Scroll bar display format", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:54:58", + "update_time": "2026-08-02 03:54:58", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642797, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "wrapClass", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "包裹容器的自定义类名", + "field_desc_en": "Custom class name of the wrapper container", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:53:17", + "update_time": "2026-08-02 03:53:17", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785643580, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 2, + "field_name": "scroll", + "field_type": [ + "1", + "2" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "滚动时触发", + "field_desc_en": "Triggered while scrolling", + "field_required": 0, + "event_input": "(context:{e:Event})", + "create_time": "2026-08-02 04:06:20", + "update_time": "2026-08-02 04:06:20", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Events", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String", + "Number" + ] + }, + { + "id": 1785647487, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 4, + "field_name": "getValues", + "field_type": [ + "1", + "2" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "获取包含完整滚动信息的视图对象", + "field_desc_en": "Get the view object containing complete scrolling information", + "field_required": 1, + "event_input": "", + "create_time": "2026-08-02 05:11:28", + "update_time": "2026-08-02 05:11:28", + "event_output": "PositionValues 【 interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }】", + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Functions", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String", + "Number" + ] + }, + { + "id": 1785646744, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 4, + "field_name": "scrollTo", + "field_type": [ + "32" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "滚动到一组特定坐标", + "field_desc_en": "Scroll to a specific set of coordinates", + "field_required": 1, + "event_input": "(options: { top?: number; left?: number; behavior?: ScrollBehavior })", + "create_time": "2026-08-02 04:59:04", + "update_time": "2026-08-02 04:59:04", + "event_output": "", + "custom_field_type": "ScrollToFn【type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }】", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Functions", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Function" + ] + }, + { + "id": 1785646985, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 4, + "field_name": "scrollToEdge", + "field_type": [ + "32" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "滚动到某一边", + "field_desc_en": "Scroll to one side", + "field_required": 1, + "event_input": "(position:PositionEdge) 【type PositionEdge = \"left\"|\"right\"|\"top\"|\"bottom\"】", + "create_time": "2026-08-02 05:03:05", + "update_time": "2026-08-02 05:03:05", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Functions", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Function" + ] + }, + { + "id": 1785642818, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 256, + "field_name": "viewStyle", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "视图(内容区)的自定义内联样式", + "field_desc_en": "Custom inline styles for view (content area)", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:53:38", + "update_time": "2026-08-02 03:53:38", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "CSS Variables", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642756, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 256, + "field_name": "wrapStyle", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "包裹容器的自定义内联样式", + "field_desc_en": "Custom inline styles for wrapping containers", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:52:36", + "update_time": "2026-08-02 03:52:36", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "CSS Variables", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785650133, + "platform_framework": [ + "1", + "2" + ], + "component": "ScrollbarValues", + "field_category": 1, + "field_name": "PositionEdge", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "left/right/top/bottom", + "field_desc_zh": "滚动到某一边", + "field_desc_en": "Scroll to one side", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 05:55:33", + "update_time": "2026-08-02 05:55:33", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785650340, + "platform_framework": [ + "1", + "2" + ], + "component": "ScrollbarValues", + "field_category": 1, + "field_name": "PositionEdge", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "left/right/top/bottom", + "field_desc_zh": "滚动到某一边", + "field_desc_en": "Scroll to one side", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 05:59:00", + "update_time": "2026-08-02 05:59:00", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785650036, + "platform_framework": [ + "1", + "2" + ], + "component": "ScrollbarValues", + "field_category": 1, + "field_name": "PositionValues", + "field_type": [ + "8" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "获取包含完整滚动信息的视图对象", + "field_desc_en": "Get the view object containing complete scrolling information", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 05:53:56", + "update_time": "2026-08-02 05:53:56", + "event_output": null, + "custom_field_type": "{left: (scrollLeft / (scrollWidth - clientWidth)) || 0,top: (scrollTop / (scrollHeight - clientHeight)) || 0,scrollLeft,scrollTop,scrollWidth,scrollHeight,clientWidth, clientHeight}", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Object" + ] + }, { "id": 1542, "platform_framework": [ diff --git a/packages/scripts/map.json b/packages/scripts/map.json index 70eabcf1d..368821b5c 100644 --- a/packages/scripts/map.json +++ b/packages/scripts/map.json @@ -877,6 +877,10 @@ "value": "Row", "label": "栅格-横向" }, + { + "value": "Scrollbar", + "label": "滚动条" + }, { "value": "Search", "label": "搜索" diff --git a/packages/server/controllers/ComponentApi/const.ts b/packages/server/controllers/ComponentApi/const.ts index df0d48d17..ee10f4c9a 100644 --- a/packages/server/controllers/ComponentApi/const.ts +++ b/packages/server/controllers/ComponentApi/const.ts @@ -368,6 +368,7 @@ export const COMPONENTS_PC: Array = [ { value: 'AutoCompleteConfig', label: '自动填充全局配置', type: 'TS' }, { value: 'QRCode', label: '二维码' }, { value: 'QRCodeConfig', label: '二维码全局配置', type: 'TS' }, + { value: 'Scrollbar', label: '滚动条' }, ].sort((a, b) => a.value.localeCompare(b.value)); export const COMPONENTS_MOBILE: Array = [