[Improvement] PullRefresh: support trigger loading animation (#684)

This commit is contained in:
neverland 2018-03-13 16:36:56 +08:00 committed by GitHub
parent c45cbb632f
commit 4006a86cec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View File

@ -45,7 +45,7 @@ export default {
.van-pull-refresh {
&,
&__track {
height: 100%;
height: calc(100vh - 50px);
}
}

View File

@ -76,10 +76,8 @@ export default create({
watch: {
value(val) {
if (!val) {
this.duration = this.animationDuration;
this.getStatus(0);
}
this.getStatus(val ? this.headHeight : 0, val);
}
},

View File

@ -4,7 +4,6 @@ import Toast from 'packages/toast';
import { mount } from 'avoriaz';
import { DOMChecker } from '../utils';
import skuMockData from '../../docs/demos/mock/sku';
import repeat from 'lodash/repeat';
const data = skuMockData['zh-CN'];
const { skuHelper } = Sku;
@ -13,6 +12,13 @@ const initialSku = {
s1: '30349',
s2: '1193'
};
const repeat = (str, count) => {
let result = '';
for (let i = 0; i < count; i++) {
result += str;
}
return result;
};
const File = function() {
this.name = 'test';