tiny-vue/examples/sites/demos/mobile/app/pull-refresh/result-text.vue

47 lines
914 B
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<tiny-pull-refresh
:pullUp="pullUpLoad"
:pullDown="pullDownRefresh"
success-text="运气真好"
failed-text="哦哦出错了!"
>
<h3>hello pull-refresh</h3>
</tiny-pull-refresh>
</template>
<script>
import { PullRefresh } from '@opentiny/vue'
export default {
components: {
TinyPullRefresh: PullRefresh
},
data() {
return {
pullUpLoad: {
handler: () => this.handlerPullUpLoad()
},
pullDownRefresh: {
handler: () => this.handlerPullDownRefresh()
}
}
},
methods: {
handlerPullUpLoad() {
return new Promise((resolve, reject) => {
setTimeout(() => {
reject(new Error())
}, 1000)
})
},
handlerPullDownRefresh() {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, 1000)
})
}
}
}
</script>