vue-masonry-wall
A pure vue responsive masonry implementation without direct dom manipulation, ssr friendly with lazy appending. I created this because other libraries has no SSR support, and I needed a pure vue implementation.
Installation
Features
- No Direct DOM Manipulation
- SSR friendly, able to load and re hydrate later
- 1 dependency only, no legacy dependencies
- Auto lazy appending, scroll to auto load more
- Auto item placement, will find best column
- Responsive design
Usage
Basic
Nuxt SSR
Add :ssr="{columns: 2}"
to masonry so that during SSR, it will be load in 2 columns.
SSR has no clue what is the size of your height of your element or width of the browser.
You can however guess based on user-agent: https://github.com/nuxt-community/device-module
This param allow you to preload a config for SSR rendering, it will distribute your items into all columns evenly.