uniapp 下拉刷新终极方案

z-paging

【z-paging下拉刷新、上拉加载】高性能,全平台兼容。支持虚拟列表,分页全自动处理

非常好用, 必须点赞。

uniapp 官方的下拉刷新好像有好多问题,具体是什么忘记了,反正神坑无比。

z-paging 挺好用的, 不过好像会和局部的 scroll-view 组件冲突,现象就是下拉刷新会一跳一跳的, 不知道怎么解决, 不过问题不是很大, 将就用吧。

下拉刷新使用

vue 复制代码
<ZPaging
    ref="pagingRef"
    :fixed="false"
    refresher-only
    @onRefresh="onRefresh"
    refresher-default-text="下拉刷新"
    refresher-pulling-text="释放刷新"
    refresher-refreshing-text="刷新中..."
    refresher-complete-text="刷新完成"
    :refresher-title-style="{ fontSize: '14px' }"
>
    <view>
            <Total @onRefresh="onRefreshed"></Total>
            <City @onRefresh="onRefreshed"></City>
            <Brand @onRefresh="onRefreshed"></Brand>
    </view>
</ZPaging>

// import ZPaging from "@/uni_modules/z-paging/components/z-paging/z-paging.vue";

有一个问题在线求助, 就是在底部会出现大面积留白

ai 聊天组件

对话内容和输入框都可以自定义。非常方便。具体的官方有示例

vue 复制代码
<z-paging
      ref="pagingRef"
      :fixed="false"
      :refresher-enabled="false"
      :refresher-default-style="'none'"
      v-model="chatHistories"
      use-chat-record-mode
      :safe-area-inset-bottom="false"
      bottom-bg-color="#FBFAFA"
      :calcKeyboardHeight="calcKeyboardHeight"
    >
      <!-- for循环渲染聊天记录列表 -->
      <view
        v-for="(chatItem, index) in chatHistories"
        :key="chatItem.id"
        style="position: relative"
      >
        <!-- style="transform: scaleY(-1)"必须写,否则会导致列表倒置 -->
        <!-- 注意不要直接在chat-item组件标签上设置style,因为在微信小程序中是无效的,请包一层view -->
        <view style="transform: scaleY(-1)">
          <!-- 对话消息组件 -->
          <ChatItem :message="chatItem" @onSelectOption="handleSelectOption" />
        </view>
      </view>
      <!-- 底部聊天输入框 -->
      <template #bottom>
        <view class="chat-input-container">
          <Question
            :status="networkStatus"
            :question="userMsg"
            @onSend="(params: any) => doSend(params.question)"
            @onCancel="handleCancel"
          />
        </view>
      </template>
    </z-paging>
相关推荐
羊小猪~~1 小时前
【QT】--文件操作
前端·数据库·c++·后端·qt·qt6.3
晚风资源组2 小时前
CSS文字和图片在容器内垂直居中的简单方法
前端·css·css3
Miketutu2 小时前
Flutter学习 - 组件通信与网络请求Dio
开发语言·前端·javascript
光影少年4 小时前
前端如何调用gpu渲染,提升gpu渲染
前端·aigc·web·ai编程
Surplusx4 小时前
运用VS Code前端开发工具完成网页头部导航栏
前端·html
小宇的天下5 小时前
Calibre 3Dstack --每日一个命令day13【enclosure】(3-13)
服务器·前端·数据库
一只小bit6 小时前
Qt 文件:QFile 文件读写与管理教程
前端·c++·qt·gui
午安~婉6 小时前
整理知识点
前端·javascript·vue
军军君016 小时前
Three.js基础功能学习十二:常量与核心
前端·javascript·学习·3d·threejs·three·三维
m0_748254666 小时前
CSS AI 编程
前端·css·人工智能