优化全局下拉刷新
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<scroll-view class="page" scroll-y>
|
||||
<view class="page">
|
||||
<view class="list-container">
|
||||
<view v-if="currentList.length === 0" class="empty-state">
|
||||
<uni-icons type="info" size="30" color="#ccc"></uni-icons>
|
||||
@@ -43,13 +43,13 @@
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;height:2rpx;"></view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { onShow,onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import {getQuestionnaireList} from '../api/apiSub.js'
|
||||
|
||||
// 状态栏高度
|
||||
@@ -102,7 +102,9 @@
|
||||
}
|
||||
}catch(err){
|
||||
uni.showToast({ title: err.msg ||'网络异常', icon: 'none' })
|
||||
}
|
||||
}finally{
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
// 列表项点击(index 控制高亮)
|
||||
@@ -131,10 +133,13 @@
|
||||
})
|
||||
}
|
||||
|
||||
// 生命周期:每次显示时刷新数据
|
||||
onShow(() => {
|
||||
getDataList()
|
||||
})
|
||||
// 下拉刷新
|
||||
onPullDownRefresh(() => {
|
||||
getDataList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -145,9 +150,10 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.contentStyle {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
// display: flex;
|
||||
// flex-direction: column;
|
||||
min-height: 100%;
|
||||
// height: 100%;
|
||||
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user