feat(onPullDownRefresh): 原生下拉刷新实现,但效果并不好

This commit is contained in:
Burt 2024-01-03 20:42:39 +08:00
parent 6683e0a466
commit 49a4c255e2
2 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,7 @@
"path": "pages/my/index", "path": "pages/my/index",
"style": { "style": {
"navigationBarTitleText": "我的", "navigationBarTitleText": "我的",
"enablePullDownRefresh": true,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
} }

View File

@ -40,8 +40,17 @@
<script lang="ts" setup> <script lang="ts" setup>
import useNavbarWeixin from '@/hooks/useNavbarWeixin' import useNavbarWeixin from '@/hooks/useNavbarWeixin'
import { onPullDownRefresh } from '@dcloudio/uni-app'
const { pages, isTabbar, onScrollToLower, safeAreaInsets } = useNavbarWeixin() const { pages, isTabbar, onScrollToLower, safeAreaInsets } = useNavbarWeixin()
//
onPullDownRefresh(() => {
console.log('refresh')
setTimeout(function fn() {
uni.stopPullDownRefresh()
}, 1000)
})
</script> </script>
<style lang="scss"> <style lang="scss">