Skip to content

Commit

Permalink
docs(Sticky): sync api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Sep 3, 2024
1 parent 416e914 commit 763a8c9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 29 deletions.
11 changes: 9 additions & 2 deletions src/sticky/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@

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

### Sticky Events

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 | \-
13 changes: 8 additions & 5 deletions src/sticky/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 | 内容样式类
6 changes: 1 addition & 5 deletions src/sticky/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ const props: TdStickyProps = {
type: Boolean,
value: false,
},
/** 根结点外部样式 */
externalClasses: {
type: Array,
},
/** 吸顶时与顶部的距离,单位`px` */
offsetTop: {
type: Number,
type: null,
value: 0,
},
/** 吸顶时的 z-index */
Expand Down
19 changes: 2 additions & 17 deletions src/sticky/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ export interface TdStickyProps {
type: undefined;
value?: null;
};
/**
* 自定义组件样式
* @default ''
*/
style?: {
type: StringConstructor;
value?: string;
};
/**
* 是否禁用组件
* @default false
Expand All @@ -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
Expand Down

0 comments on commit 763a8c9

Please sign in to comment.