diff --git a/src/sticky/README.en-US.md b/src/sticky/README.en-US.md index 4b36d156b..643e0e6a7 100644 --- a/src/sticky/README.en-US.md +++ b/src/sticky/README.en-US.md @@ -6,9 +6,10 @@ name | type | default | description | required -- | -- | -- | -- | -- +style | Object | - | CSS(Cascading Style Sheets) | N +custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N container | Function | - | \- | N disabled | Boolean | false | \- | N -external-classes | Array | - | `['t-class']` | N offset-top | String / Number | 0 | \- | N z-index | Number | 99 | \- | N @@ -16,4 +17,10 @@ z-index | Number | 99 | \- | N name | params | description -- | -- | -- -scroll | `(detail: { scrollTop: number, isFixed: boolean })` | \- +scroll | `(detail: { scrollTop: number, isFixed: boolean })` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) +### Sticky External Classes + +className | Description +-- | -- +t-class | \- +t-class-content | \- diff --git a/src/sticky/README.md b/src/sticky/README.md index 53dc10d58..d96f66550 100644 --- a/src/sticky/README.md +++ b/src/sticky/README.md @@ -45,10 +45,13 @@ isComponent: true ## API + ### Sticky Props -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- +style | Object | - | 样式 | N +custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N container | Function | - | 函数返回容器对应的 NodesRef 节点,将对应节点指定为组件的外部容器,滚动时组件会始终保持在容器范围内,当组件即将超出容器底部时,会返回原位置。 | N disabled | Boolean | false | 是否禁用组件 | N offset-top | String / Number | 0 | 吸顶时与顶部的距离,单位`px` | N @@ -58,10 +61,10 @@ z-index | Number | 99 | 吸顶时的 z-index | N 名称 | 参数 | 描述 -- | -- | -- -scroll | `(detail: { scrollTop: number, isFixed: boolean })` | 滚动时触发,scrollTop: 距离顶部位置,isFixed: 是否吸顶 +scroll | `(detail: { scrollTop: number, isFixed: boolean })` | 滚动时触发,scrollTop: 距离顶部位置,isFixed: 是否吸顶。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) +### Sticky External Classes -### Sticky 外部样式类 -类名 | 说明 --- | -- +类名 | 描述 +-- | -- t-class | 根节点样式类 t-class-content | 内容样式类 diff --git a/src/sticky/props.ts b/src/sticky/props.ts index f463d463e..a00df5d22 100644 --- a/src/sticky/props.ts +++ b/src/sticky/props.ts @@ -15,13 +15,9 @@ const props: TdStickyProps = { type: Boolean, value: false, }, - /** 根结点外部样式 */ - externalClasses: { - type: Array, - }, /** 吸顶时与顶部的距离,单位`px` */ offsetTop: { - type: Number, + type: null, value: 0, }, /** 吸顶时的 z-index */ diff --git a/src/sticky/type.ts b/src/sticky/type.ts index e60c4b480..dabd4eb0e 100644 --- a/src/sticky/type.ts +++ b/src/sticky/type.ts @@ -12,14 +12,6 @@ export interface TdStickyProps { type: undefined; value?: null; }; - /** - * 自定义组件样式 - * @default '' - */ - style?: { - type: StringConstructor; - value?: string; - }; /** * 是否禁用组件 * @default false @@ -28,20 +20,13 @@ export interface TdStickyProps { type: BooleanConstructor; value?: boolean; }; - /** - * 根结点外部样式 - */ - externalClasses?: { - type: ArrayConstructor; - value?: ['t-class']; - }; /** * 吸顶时与顶部的距离,单位`px` * @default 0 */ offsetTop?: { - type: NumberConstructor; - value?: number; + type: null; + value?: string | number; }; /** * 吸顶时的 z-index