Skip to content

Commit 6567911

Browse files
authored
feat(PullDownRefresh): add disabled prop (#619)
1 parent 1e8382b commit 6567911

File tree

10 files changed

+138
-0
lines changed

10 files changed

+138
-0
lines changed

db/TDesign.db

0 Bytes
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
3+
* */
4+
5+
import { TdPullDownRefreshProps } from './type';
6+
7+
export const pullDownRefreshDefaultProps: TdPullDownRefreshProps = {
8+
disabled: false,
9+
loadingBarHeight: 50,
10+
loadingTexts: [],
11+
maxBarHeight: 80,
12+
refreshTimeout: 3000,
13+
defaultValue: false,
14+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
:: BASE_DOC ::
2+
3+
## API
4+
5+
6+
### PullDownRefresh Props
7+
8+
name | type | default | description | required
9+
-- | -- | -- | -- | --
10+
className | String | - | className of component | N
11+
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
12+
disabled | Boolean | false | disabled pull down refresh | N
13+
loadingBarHeight | String / Number | 50 | \- | N
14+
loadingProps | Object | - | Typescript:`LoadingProps`[Loading API Documents](./loading?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/pull-down-refresh/type.ts) | N
15+
loadingTexts | Array | [] | Typescript:`string[]` | N
16+
maxBarHeight | String / Number | 80 | \- | N
17+
refreshTimeout | Number | 3000 | \- | N
18+
value | Boolean | false | \- | N
19+
defaultValue | Boolean | false | uncontrolled property | N
20+
onChange | Function | | Typescript:`(value: boolean) => void`<br/> | N
21+
onRefresh | Function | | Typescript:`() => void`<br/> | N
22+
onScrolltolower | Function | | Typescript:`() => void`<br/> | N
23+
onTimeout | Function | | Typescript:`() => void`<br/> | N
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
:: BASE_DOC ::
2+
3+
## API
4+
5+
6+
### PullDownRefresh Props
7+
8+
名称 | 类型 | 默认值 | 描述 | 必传
9+
-- | -- | -- | -- | --
10+
className | String | - | 类名 | N
11+
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
12+
disabled | Boolean | false | 是否禁用下拉刷新 | N
13+
loadingBarHeight | String / Number | 50 | 加载中下拉高度,如果值为数字则单位是:'px' | N
14+
loadingProps | Object | - | 加载loading样式。TS 类型:`LoadingProps`[Loading API Documents](./loading?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/pull-down-refresh/type.ts) | N
15+
loadingTexts | Array | [] | 提示语,组件内部默认值为 ['下拉刷新', '松手刷新', '正在刷新', '刷新完成']。TS 类型:`string[]` | N
16+
maxBarHeight | String / Number | 80 | 最大下拉高度,如果值为数字则单位是:'px' | N
17+
refreshTimeout | Number | 3000 | 刷新超时时间 | N
18+
value | Boolean | false | 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态 | N
19+
defaultValue | Boolean | false | 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态。非受控属性 | N
20+
onChange | Function | | TS 类型:`(value: boolean) => void`<br/>下拉或收起时触发,用户手势往下滑动触发下拉状态,手势松开触发收起状态 | N
21+
onRefresh | Function | | TS 类型:`() => void`<br/>结束下拉时触发 | N
22+
onScrolltolower | Function | | TS 类型:`() => void`<br/>滚动到页面底部时触发 | N
23+
onTimeout | Function | | TS 类型:`() => void`<br/>刷新超时触发 | N
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/* eslint-disable */
2+
3+
/**
4+
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
5+
* */
6+
7+
import { LoadingProps } from '../loading';
8+
9+
export interface TdPullDownRefreshProps {
10+
/**
11+
* 是否禁用下拉刷新
12+
* @default false
13+
*/
14+
disabled?: boolean;
15+
/**
16+
* 加载中下拉高度,如果值为数字则单位是:'px'
17+
* @default 50
18+
*/
19+
loadingBarHeight?: string | number;
20+
/**
21+
* 加载loading样式
22+
*/
23+
loadingProps?: LoadingProps;
24+
/**
25+
* 提示语,组件内部默认值为 ['下拉刷新', '松手刷新', '正在刷新', '刷新完成']
26+
* @default []
27+
*/
28+
loadingTexts?: string[];
29+
/**
30+
* 最大下拉高度,如果值为数字则单位是:'px'
31+
* @default 80
32+
*/
33+
maxBarHeight?: string | number;
34+
/**
35+
* 刷新超时时间
36+
* @default 3000
37+
*/
38+
refreshTimeout?: number;
39+
/**
40+
* 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态
41+
* @default false
42+
*/
43+
value?: boolean;
44+
/**
45+
* 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态,非受控属性
46+
* @default false
47+
*/
48+
defaultValue?: boolean;
49+
/**
50+
* 下拉或收起时触发,用户手势往下滑动触发下拉状态,手势松开触发收起状态
51+
*/
52+
onChange?: (value: boolean) => void;
53+
/**
54+
* 结束下拉时触发
55+
*/
56+
onRefresh?: () => void;
57+
/**
58+
* 滚动到页面底部时触发
59+
*/
60+
onScrolltolower?: () => void;
61+
/**
62+
* 刷新超时触发
63+
*/
64+
onTimeout?: () => void;
65+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { TdPullDownRefreshProps } from './type';
88
import { PropType } from 'vue';
99

1010
export default {
11+
/** 是否禁用下拉刷新 */
12+
disabled: Boolean,
1113
/** 加载中下拉高度,如果值为数字则单位是:'px' */
1214
loadingBarHeight: {
1315
type: [String, Number] as PropType<TdPullDownRefreshProps['loadingBarHeight']>,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
name | type | default | description | required
88
-- | -- | -- | -- | --
9+
disabled | Boolean | false | disabled pull down refresh | N
910
loadingBarHeight | String / Number | 50 | \- | N
1011
loadingProps | Object | - | Typescript:`LoadingProps`[Loading API Documents](./loading?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/pull-down-refresh/type.ts) | N
1112
loadingTexts | Array | [] | Typescript:`string[]` | N

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
名称 | 类型 | 默认值 | 描述 | 必传
88
-- | -- | -- | -- | --
9+
disabled | Boolean | false | 是否禁用下拉刷新 | N
910
loadingBarHeight | String / Number | 50 | 加载中下拉高度,如果值为数字则单位是:'px' | N
1011
loadingProps | Object | - | 加载loading样式。TS 类型:`LoadingProps`[Loading API Documents](./loading?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/pull-down-refresh/type.ts) | N
1112
loadingTexts | Array | [] | 提示语,组件内部默认值为 ['下拉刷新', '松手刷新', '正在刷新', '刷新完成']。TS 类型:`string[]` | N

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
import { LoadingProps } from '../loading';
88

99
export interface TdPullDownRefreshProps {
10+
/**
11+
* 是否禁用下拉刷新
12+
* @default false
13+
*/
14+
disabled?: boolean;
1015
/**
1116
* 加载中下拉高度,如果值为数字则单位是:'px'
1217
* @default 50

packages/scripts/api.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92593,6 +92593,8 @@
9259392593
{
9259492594
"id": 1718962073,
9259592595
"platform_framework": [
92596+
"8",
92597+
"16",
9259692598
"64"
9259792599
],
9259892600
"component": "PullDownRefresh",
@@ -92621,6 +92623,8 @@
9262192623
"support_default_value": 0,
9262292624
"field_category_text": "Props",
9262392625
"platform_framework_text": [
92626+
"Vue(Mobile)",
92627+
"React(Mobile)",
9262492628
"Miniprogram"
9262592629
],
9262692630
"field_type_text": [

0 commit comments

Comments
 (0)