mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-23 15:09:16 +08:00
[Improvement] PullRefresh: add disabled prop (#1336)
This commit is contained in:
parent
29bb446e94
commit
2aa26d09ba
@ -49,6 +49,8 @@ export default {
|
|||||||
| loading-text | Text to show when loading | `String` | `Loading...` |
|
| loading-text | Text to show when loading | `String` | `Loading...` |
|
||||||
| animation-duration | Animation duration | `Number` | `300` |
|
| animation-duration | Animation duration | `Number` | `300` |
|
||||||
| head-height | Height of head | `Number` | `50` |
|
| head-height | Height of head | `Number` | `50` |
|
||||||
|
| disabled | Whether to disable | `Boolean` | `false` |
|
||||||
|
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ export default create({
|
|||||||
mixins: [Touch],
|
mixins: [Touch],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
disabled: Boolean,
|
||||||
pullingText: String,
|
pullingText: String,
|
||||||
loosingText: String,
|
loosingText: String,
|
||||||
loadingText: String,
|
loadingText: String,
|
||||||
@ -70,6 +71,10 @@ export default create({
|
|||||||
transition: `${this.duration}ms`,
|
transition: `${this.duration}ms`,
|
||||||
transform: `translate3d(0,${this.height}px, 0)`
|
transform: `translate3d(0,${this.height}px, 0)`
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
untouchable() {
|
||||||
|
return this.status === 'loading' || this.disabled;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -86,7 +91,7 @@ export default create({
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onTouchStart(event) {
|
onTouchStart(event) {
|
||||||
if (this.status === 'loading') {
|
if (this.untouchable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.getCeiling()) {
|
if (this.getCeiling()) {
|
||||||
@ -96,7 +101,7 @@ export default create({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onTouchMove(event) {
|
onTouchMove(event) {
|
||||||
if (this.status === 'loading') {
|
if (this.untouchable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +122,7 @@ export default create({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onTouchEnd() {
|
onTouchEnd() {
|
||||||
if (this.status === 'loading') {
|
if (this.untouchable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ export default {
|
|||||||
| loading-text | 加载过程中顶部文案 | `String` | `加载中...` |
|
| loading-text | 加载过程中顶部文案 | `String` | `加载中...` |
|
||||||
| animation-duration | 动画时长 | `Number` | `300` |
|
| animation-duration | 动画时长 | `Number` | `300` |
|
||||||
| head-height | 顶部内容高度 | `Number` | `50` |
|
| head-height | 顶部内容高度 | `Number` | `50` |
|
||||||
|
| disabled | 是否禁用 | `Boolean` | `false` |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user