-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSR not working properly with this package #9
Comments
Hmmm, I can't really see what is wrong here. |
Facing some kind of same issue :
Working fine without Example : <template>
<div class="container">
<div>
<vue-masonry-wall
:items="albums"
:options="options"
:ssr="{ columns: 2 }" // <--- here
>
<template v-slot:default="{ item }">
<album-card-component :album="item" />
</template>
</vue-masonry-wall>
</div>
</div>
</template>
<script lang="ts">
import Vue from 'vue'
import { Component } from 'nuxt-property-decorator'
import VueMasonryWall from 'vue-masonry-wall'
import Album from '~/models/album'
import AlbumCardComponent from '~/components/AlbumCardComponent.vue'
@Component({
components: { AlbumCardComponent, VueMasonryWall },
})
export default class AlbumsIndex extends Vue {
albums!: Album[]
options = {
width: 300,
padding: {
default: 12,
1: 6,
2: 8,
},
}
async asyncData({ error }): Promise<{ albums: Album[] }> {
const albums = await fetch(`https://somewhere.com/api/albums`)
.then((res) => res.json())
.then((json) => json.data)
.catch(() => {
error({ statusCode: 404, message: 'Album not found' })
})
return { albums }
}
}
</script> |
I have this problem also. If I remove the Otherwise, the masonry-wall is 0 height with the template slot not rendered. Spent a day trying to get this to work and doing research on this problem -- finally stumbled across this issue. |
Dear @thanateros, @dolnikov? |
when you pass ssr object to the component at mount hook if condition this.columns.length !== this._columnSize() does not accur if (this.columns.length !== this._columnSize()) { |
Same not working properly |
using SSR vue-masonry-wall renders an item in full width without columns |
Just to confirm...does this work for the latest NuxtJS v2.15.8? I ask because it does not for me. Thanks. Here's my reproduction link: https://codesandbox.io/s/nuxt-masonrywall-h55wy?file=/components/Tutorial.vue |
Just found this ported version of vue-masonry-wall. Works with SSR! https://vue2-masonry-wall.yeger.eu/ Here is my test as well: https://codesandbox.io/s/yeger-masonry-vue2-v03xv?file=/pages/index.vue |
Hi,
I followed the Nuxt SSR you are adding in the README with
:ssr="{columns: 2}"
but nothing got rendered in the page
any advice please?
here are my template code
and i'm providing the data from the asyncData as follow:
The text was updated successfully, but these errors were encountered: