vue滾動條滾到到底部觸發的方法


html

 <div style="height:200px;overflow-y:auto;" @scroll="scrollEvent">
                    <div class="people_list" :key="index" v-for="(item,index) in peoplelist">
                        <img class="people_list_header" :src="item.avatar" />
                        <div>
                            <span class="people_list_name">{{item.name}}</span>
                            <span v-show="item.identity_type==1" class="people_list_wechat">@微信</span>
                            <span v-show="item.identity_type==2" class="people_list_wechat">@企業微信</span>
                            <p class="people_list_time">添加時間:{{item.create_time}}</p>
                        </div>
                    </div>
                </div>

方法

//滾動條觸發事件
        scrollEvent(e) {
            console.log(e)
            if (e.srcElement.scrollTop + e.srcElement.clientHeight == e.srcElement.scrollHeight ) {
                
            }
        },

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM