From a7e6d25d3fd34377a82fed4a2d0dbd437a37c215 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Fri, 31 Jan 2020 21:53:52 +0100 Subject: [PATCH] Lazy loading for list items. This is somewhat inefficient because each list item has its own instance of a intersectionObserver. Improvements include: - Poster has placeholder image as source from mount - When component mounts we attach the observer - When observerd in viewport find - Find the correct image height based on the placeholders height - Change src to dynamic poster url --- src/components/MoviesListItem.vue | 75 +++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 14 deletions(-) diff --git a/src/components/MoviesListItem.vue b/src/components/MoviesListItem.vue index 5a2ac51..6a46f92 100644 --- a/src/components/MoviesListItem.vue +++ b/src/components/MoviesListItem.vue @@ -1,11 +1,12 @@