Skip to content

Commit 5241443

Browse files
feat(pull-down-refresh): add success-duration (#677)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent de4d9bc commit 5241443

File tree

14 files changed

+85
-5
lines changed

14 files changed

+85
-5
lines changed

db/TDesign.db

0 Bytes
Binary file not shown.

packages/products/tdesign-miniprogram/src/pull-down-refresh/README.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ max-bar-height | String / Number | 80 | \- | N
2020
refresh-timeout | Number | 3000 | \- | N
2121
scroll-into-view | String | - | `1.1.5` | N
2222
show-scrollbar | Boolean | true | \- | N
23+
success-duration | String / Number | 500 | \- | N
2324
upper-threshold | String / Number | 50 | `1.1.5` | N
2425
using-custom-navbar | Boolean | false | \- | N
2526
value | Boolean | false | \- | N

packages/products/tdesign-miniprogram/src/pull-down-refresh/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场
1111
disabled | Boolean | false | 是否禁用下拉刷新 | N
1212
enable-back-to-top | Boolean | true | `1.1.5`。iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只支持竖向。自 2.27.3 版本开始,若非显式设置为 false,则在显示尺寸大于屏幕 90% 时自动开启 | N
1313
enable-passive | Boolean | false | `1.1.5`。开启 passive 特性,能优化一定的滚动性能 | N
14-
header | Slot | - | `1.2.10`[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
14+
header | Slot | - | `1.2.10`头部。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
1515
loading-bar-height | String / Number | 50 | 加载中下拉高度,如果值为数字则单位是:'px' | N
1616
loading-props | Object | - | 加载loading样式。TS 类型:`LoadingProps`[Loading API Documents](./loading?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/pull-down-refresh/type.ts) | N
1717
loading-texts | Array | [] | 提示语,组件内部默认值为 ['下拉刷新', '松手刷新', '正在刷新', '刷新完成']。TS 类型:`string[]` | N
@@ -20,6 +20,7 @@ max-bar-height | String / Number | 80 | 最大下拉高度,如果值为数字
2020
refresh-timeout | Number | 3000 | 刷新超时时间 | N
2121
scroll-into-view | String | - | `1.1.5`。值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素 | N
2222
show-scrollbar | Boolean | true | 滚动条显隐控制 (同时开启 enhanced 属性后生效) | N
23+
success-duration | String / Number | 500 | 刷新成功提示展示时长,单位 'ms' | N
2324
upper-threshold | String / Number | 50 | `1.1.5`。距顶部/左边多远时,触发 scrolltoupper 事件 | N
2425
using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
2526
value | Boolean | false | 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态 | N

packages/products/tdesign-miniprogram/src/pull-down-refresh/props.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ const props: TdPullDownRefreshProps = {
6060
type: Boolean,
6161
value: true,
6262
},
63+
/** 刷新成功提示展示时长,单位 'ms' */
64+
successDuration: {
65+
type: null,
66+
value: 500,
67+
},
6368
/** 距顶部/左边多远时,触发 scrolltoupper 事件 */
6469
upperThreshold: {
6570
type: null,

packages/products/tdesign-miniprogram/src/pull-down-refresh/type.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ export interface TdPullDownRefreshProps {
9494
type: BooleanConstructor;
9595
value?: boolean;
9696
};
97+
/**
98+
* 刷新成功提示展示时长,单位 'ms'
99+
* @default 500
100+
*/
101+
successDuration?: {
102+
type: null;
103+
value?: string | number;
104+
};
97105
/**
98106
* 距顶部/左边多远时,触发 scrolltoupper 事件
99107
* @default 50

packages/products/tdesign-mobile-react/src/pull-down-refresh/defaultProps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ export const pullDownRefreshDefaultProps: TdPullDownRefreshProps = {
1010
loadingTexts: [],
1111
maxBarHeight: 80,
1212
refreshTimeout: 3000,
13+
successDuration: 500,
1314
defaultValue: false,
1415
};

packages/products/tdesign-mobile-react/src/pull-down-refresh/pull-down-refresh.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
## API
44

5-
65
### PullDownRefresh Props
76

87
name | type | default | description | required
@@ -15,6 +14,7 @@ loadingProps | Object | - | Typescript:`LoadingProps`,[Loading API Documents
1514
loadingTexts | Array | [] | Typescript:`string[]` | N
1615
maxBarHeight | String / Number | 80 | \- | N
1716
refreshTimeout | Number | 3000 | \- | N
17+
successDuration | String / Number | 500 | \- | N
1818
value | Boolean | false | \- | N
1919
defaultValue | Boolean | false | uncontrolled property | N
2020
onChange | Function | | Typescript:`(value: boolean) => void`<br/> | N

packages/products/tdesign-mobile-react/src/pull-down-refresh/pull-down-refresh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
## API
44

5-
65
### PullDownRefresh Props
76

87
名称 | 类型 | 默认值 | 描述 | 必传
@@ -15,6 +14,7 @@ loadingProps | Object | - | 加载loading样式。TS 类型:`LoadingProps`,[
1514
loadingTexts | Array | [] | 提示语,组件内部默认值为 ['下拉刷新', '松手刷新', '正在刷新', '刷新完成']。TS 类型:`string[]` | N
1615
maxBarHeight | String / Number | 80 | 最大下拉高度,如果值为数字则单位是:'px' | N
1716
refreshTimeout | Number | 3000 | 刷新超时时间 | N
17+
successDuration | String / Number | 500 | 刷新成功提示展示时长,单位 'ms' | N
1818
value | Boolean | false | 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态 | N
1919
defaultValue | Boolean | false | 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态。非受控属性 | N
2020
onChange | Function | | TS 类型:`(value: boolean) => void`<br/>下拉或收起时触发,用户手势往下滑动触发下拉状态,手势松开触发收起状态 | N

packages/products/tdesign-mobile-react/src/pull-down-refresh/type.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export interface TdPullDownRefreshProps {
3636
* @default 3000
3737
*/
3838
refreshTimeout?: number;
39+
/**
40+
* 刷新成功提示展示时长,单位 'ms'
41+
* @default 500
42+
*/
43+
successDuration?: string | number;
3944
/**
4045
* 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态
4146
* @default false

packages/products/tdesign-mobile-vue/src/pull-down-refresh/props.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ export default {
3434
type: Number,
3535
default: 3000,
3636
},
37+
/** 刷新成功提示展示时长,单位 'ms' */
38+
successDuration: {
39+
type: [String, Number] as PropType<TdPullDownRefreshProps['successDuration']>,
40+
default: 500,
41+
},
3742
/** 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态 */
3843
value: {
3944
type: Boolean,

0 commit comments

Comments
 (0)