Skip to content

Commit

Permalink
docs(List): api sync (#1449)
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Jun 14, 2024
1 parent 0b197c2 commit 9c4f03d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
11 changes: 6 additions & 5 deletions src/list/list.en-US.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
:: BASE_DOC ::

## API

### List Props

name | type | default | description | required
-- | -- | -- | -- | --
asyncLoading | String / Slot / Function | - | Typescript:`string | TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
footer | String / Slot / Function | - | Typescript:`string | TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
header | String / Slot / Function | - | Typescript:`string | TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
asyncLoading | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
footer | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
header | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
onLoadMore | Function | | Typescript:`() => void`<br/> | N
onScroll | Function | | Typescript:`(bottomDistance:number, scrollTop: number)=> void`<br/> | N
onScroll | Function | | Typescript:`(bottomDistance: number, scrollTop: number) => void`<br/> | N

### List Events

name | params | description
-- | -- | --
load-more | \- | \-
scroll | `((bottomDistance:number, scrollTop: number)` | \-
scroll | `(bottomDistance: number, scrollTop: number)` | \-
13 changes: 7 additions & 6 deletions src/list/list.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
:: BASE_DOC ::

## API

### List Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
asyncLoading | String / Slot / Function | - | 自定义加载中。值为空不显示加载中,值为 'loading' 显示加载中状态,值为 'load-more' 显示加载更多状态。值类型为函数,则表示自定义加载状态呈现内容。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
footer | String / Slot / Function | - | 底部。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
header | String / Slot / Function | - | 头部。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
asyncLoading | String / Slot / Function | - | 自定义加载中。值为空不显示加载中,值为 'loading' 显示加载中状态,值为 'load-more' 显示加载更多状态。值类型为函数,则表示自定义加载状态呈现内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
footer | String / Slot / Function | - | 底部。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
header | String / Slot / Function | - | 头部。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
onLoadMore | Function | | TS 类型:`() => void`<br/>点击加载更多时触发 | N
onScroll | Function | | TS 类型:`(bottomDistance:number, scrollTop: number) => void`<br/>列表滚动时触发,scrollTop 表示顶部滚动距离 | N
onScroll | Function | | TS 类型:`(bottomDistance: number, scrollTop: number) => void`<br/>列表滚动时触发,bottomDistance 表示底部距离;scrollTop 表示顶部滚动距离 | N

### List Events

名称 | 参数 | 描述
-- | -- | --
load-more | \- | 点击加载更多时触发
scroll | `(bottomDistance:number, scrollTop: number)` | 列表滚动时触发,bottomDistance 表示与底部的距离;scrollTop 表示顶部滚动距离
scroll | `(bottomDistance: number, scrollTop: number)` | 列表滚动时触发,bottomDistance 表示底部距离;scrollTop 表示顶部滚动距离
4 changes: 2 additions & 2 deletions src/list/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useWindowSize, useEventListener } from '@vueuse/core';
import { useTNodeJSX } from '../hooks/tnode';
import TLoading from '../loading';
import config from '../config';
import ListProps from './props';
import props from './props';
import { useScrollParent } from '../shared';
import { useConfig } from '../config-provider/useConfig';

Expand All @@ -15,7 +15,7 @@ export default defineComponent({
components: {
TLoading,
},
props: ListProps,
props,
emits: ['load-more', 'scroll'],
setup(props, { slots }) {
const { globalConfig } = useConfig('list');
Expand Down
2 changes: 1 addition & 1 deletion src/list/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default {
},
/** 点击加载更多时触发 */
onLoadMore: Function as PropType<TdListProps['onLoadMore']>,
/** 列表滚动时触发,scrollTop 表示顶部滚动距离 */
/** 列表滚动时触发,bottomDistance 表示底部距离;scrollTop 表示顶部滚动距离 */
onScroll: Function as PropType<TdListProps['onScroll']>,
};
2 changes: 1 addition & 1 deletion src/list/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface TdListProps {
*/
onLoadMore?: () => void;
/**
* 列表滚动时触发,scrollTop 表示顶部滚动距离
* 列表滚动时触发,bottomDistance 表示底部距离;scrollTop 表示顶部滚动距离
*/
onScroll?: (bottomDistance: number, scrollTop: number) => void;
}

0 comments on commit 9c4f03d

Please sign in to comment.