vue-stack-grid icon indicating copy to clipboard operation
vue-stack-grid copied to clipboard

stack is not working on SSR production, not render stack to div (Nuxt.js)

Open carylaw opened this issue 4 years ago • 3 comments

Follow #11 @guastallaigor

in plugins/vue-stack-grid.js

import Vue from 'vue'
import { Stack, StackItem } from 'vue-stack-grid'

Vue.component('Stack', Stack)
Vue.component('StackItem', StackItem)

And then, in your nuxt.config.js you import it, and set the mode: 'client'.

plugins: [
    { src: '~/plugins/vue-stack-grid', mode: 'client' }
  ]

testing on index.vue

        <v-flex d-flex>
          <Stack :monitor-images-loaded="true" :column-min-width="320" :gutter-width="8" :gutter-height="8">
            <StackItem v-for="i in 100" :key="i">
              <img src="https://i.imgur.com/0ui5ltX.jpg" />
            </StackItem>
          </Stack>
        </v-flex>

After build: image

carylaw avatar Sep 30 '20 05:09 carylaw

What is the expected behavior? It seems you are creating them in a cycle.

BEEugene avatar Sep 30 '20 11:09 BEEugene

Got the same problem here. Funnily enough, it only fails when refreshing the page. When navigating via a nuxt-link it works perfectly fine.

Edit: This only happens when deployed to github pages, it works perfectly fine while running in developement mode.

leoVolk avatar Jan 17 '21 13:01 leoVolk

@carylaw (@leoVolk) I'm not sure I understand the problem and how it's related to #11. Could you clarify?

WouterFlorijn avatar Feb 19 '21 14:02 WouterFlorijn