收藏
回答

Kbone在适用wx-scrool-view 上拉加载页面被重新加载了?

<template>

    <div>

            <wx-scroll-view ref="wxscroll"  :scroll-into-view="tt" style="height:300px" @scrolltolower="scrolltolower(false)" :scroll-top="scrollTop"

            @refresherrefresh="onRefresh" :refresher-enabled="false" :refresher-triggered="refreshing" scroll-y="true"

            class="scroll-Y" lower-threshold="30">

            {{lists}}

            <div  style="width:100%;height:150px;" v-for="vo in lists">

                    {{vo}}


            </div>

        </wx-scroll-view>

    </div>

</template>

<script>

    export default {

        data(){

            return{

                lists:[1,2,3,4,5,6],

            };

        },

        methods:{

            onRefresh(){


            },

            scrolltolower(){

                console.log('进来了');

                this.lists.push(10);

                

            },

        }

    }

</script>

如代码所示 上拉加载的时候,滚动条又会跑到最上面,这只是一个分页的功能,但是只要给原循环数据添加数据的时候滚动条就会跑到最上面。

@社区技术运营专员-Jahozheng 

回答关注问题邀请回答
收藏

1 个回答

  • 小程序技术专员-binnie
    小程序技术专员-binnie
    2021-10-20

    下拉刷新吗,refresher-enabled需要配置为true

    2021-10-20
    有用 1
    回复 1
    • 李洪龙
      李洪龙
      发表于移动端
      2021-10-20
      是上拉加载push数据页面会被重置
      2021-10-20
      回复
登录 后发表内容