實現的功能
1.一次性獲取圖片。
2.按用戶視野范圍內看到的圖片滾動下來進行懶加載,提高瀏覽器性能。
3.不要一次性加載全部的圖片
1.給父組件綁定一個滾動監聽
1.頁面路徑:/pages/Home/index.vue
不在一個頁面的話用 EventBus去觸發。@scroll="handleScroll2"
EventBus.$emit('scrollEvent', e);
2.子路由頁面路徑:/components/Games/GameList/index2.vue
<template><view><view class="game-type-list"><view v-for="(item, index) in list" :key="item.game_code"><v