-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #470 from yuanmeda/fix/doc-pulldownRefresh413
docs(pull-down-refresh): update docs and demo
- Loading branch information
Showing
3 changed files
with
147 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,23 @@ | ||
<template> | ||
<div class="tdesign-mobile-demo"> | ||
<tdesign-demo-block title="" summary=""> | ||
<t-pull-down-refresh v-model="refreshing" @refresh="handleRefresh">下拉刷新</t-pull-down-refresh> | ||
</tdesign-demo-block> | ||
</div> | ||
<t-pull-down-refresh | ||
v-model="refreshing" | ||
:loading-texts="['下拉刷新', '松开刷新', '正在刷新', '刷新完成']" | ||
@refresh="handleRefresh" | ||
> | ||
<slot> 下拉刷新 </slot> | ||
</t-pull-down-refresh> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { ref, defineComponent } from 'vue'; | ||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
export default defineComponent({ | ||
setup(props, context) { | ||
const refreshing = ref(false); | ||
const handleRefresh = (value: any) => { | ||
refreshing.value = true; | ||
setTimeout(() => { | ||
refreshing.value = false; | ||
}, 1000); | ||
}; | ||
return { | ||
refreshing, | ||
handleRefresh, | ||
}; | ||
}, | ||
data() { | ||
return {}; | ||
}, | ||
methods: {}, | ||
}); | ||
const refreshing = ref(false); | ||
const handleRefresh = (value: any) => { | ||
refreshing.value = true; | ||
setTimeout(() => { | ||
refreshing.value = false; | ||
}, 1000); | ||
}; | ||
</script> | ||
|
||
<style lang="less" scoped></style> |
Oops, something went wrong.