mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 11:54:02 +00:00
[improvement] rename packages dir to src (#3659)
This commit is contained in:
63
src/pull-refresh/demo/index.vue
Normal file
63
src/pull-refresh/demo/index.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<demo-section name="pull-refresh">
|
||||
<van-pull-refresh
|
||||
v-model="isLoading"
|
||||
@refresh="onRefresh"
|
||||
>
|
||||
<demo-block :title="$t('basicUsage')">
|
||||
<p>{{ $t('text') }}: {{ count }}</p>
|
||||
</demo-block>
|
||||
</van-pull-refresh>
|
||||
</demo-section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
i18n: {
|
||||
'zh-CN': {
|
||||
text: '刷新次数',
|
||||
success: '刷新成功'
|
||||
},
|
||||
'en-US': {
|
||||
text: 'Refresh Count',
|
||||
success: 'Refresh success'
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
count: 0,
|
||||
isLoading: false
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
onRefresh() {
|
||||
setTimeout(() => {
|
||||
this.$toast(this.$t('success'));
|
||||
this.isLoading = false;
|
||||
this.count++;
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import "../../style/var";
|
||||
|
||||
.demo-pull-refresh {
|
||||
background-color: @white;
|
||||
|
||||
.van-pull-refresh {
|
||||
&,
|
||||
&__track {
|
||||
height: calc(100vh - 50px);
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 10px 0 0 15px;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user