Commit 26e6b749 by 李伟康

增加下拉刷新

1 parent 73e734a2
<template>
<div :class="['scroll-view', ScrollViewclass]">
<van-pull-refresh
v-model="refreshing"
@refresh="onRefresh"
:disabled="disabledRefresh"
:class="['scroll-view', ScrollViewclass]"
>
<van-list
v-model="loading"
:finished="finished"
......@@ -10,7 +15,7 @@
>
<slot></slot>
</van-list>
</div>
</van-pull-refresh>
</template>
<script type='text/ecmascript-6'>
......@@ -20,15 +25,25 @@ export default {
return {
loading: false,
finished: false,
refreshing: false
}
},
props: ['ScrollViewclass'],
props: {
ScrollViewclass: String,
disabledRefresh: {
type: Boolean,
default: true
},
},
mounted () {
},
methods: {
onLoad () {
this.$emit('ReachBottom')
},
onRefresh () {
this.$emit('onRefresh')
}
}
}
</script>
......@@ -37,5 +52,8 @@ export default {
.scroll-view {
overflow-y: scroll;
box-sizing: border-box;
.test {
height: 100%;
}
}
</style>
\ No newline at end of file
......@@ -33,6 +33,8 @@
class="list-box"
@ReachBottom="onReachBottom"
ref="scrollView"
:disabledRefresh="false"
@onRefresh="clearData"
>
<div class="box">
<template v-for="(i,index) in list">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!