1
0
Fork 0
photos/web/manage/src/Gallery.svelte

23 lines
446 B
Svelte
Raw Normal View History

2020-06-13 14:49:35 +08:00
<script>
import { onMount, afterUpdate } from 'svelte';
import Gallery from '../build/shared/js/gallery.js';
import Photo from './Photo.svelte';
2020-06-13 14:49:35 +08:00
export let photos;
let galleryEle;
let gallery;
onMount(() => {
gallery = new Gallery(galleryEle);
});
2020-06-13 14:49:35 +08:00
</script>
<main class="gallery" bind:this={galleryEle}>
2020-06-13 14:49:35 +08:00
{#each photos as photo}
<Photo {photo} on:sizechange={gallery.recompute()} />
2020-06-13 14:49:35 +08:00
{/each}
</main>
<!-- vim: set ft=html: -->