0

under nuxt.js i'm using vuetify. v-img works, but as i try to use the 'placeholder' feature, as described in the docs, it does not work. for the example i copy exactly the example that works in the docs. we suppose to see a circle loader while we wait for the image. for testing, i'm using chrome to slow down the connection. this doesn't work. there is a blank for a few seconds, then the image appears. here is the code. any idea?

<v-col cols="4"> <v-img :src="selectedItem.picture"> <template v-slot:placeholder> <v-row class="fill-height ma-0" align="center" justify="center"> <v-progress-circular indeterminate color="blue"></v-progress-circular> </v-row> </template> </v-img> </v-col> 

note: i'm not using vuetify-loader. could this be the issue?

4
  • It doesn't see any error here. What does your console say? Commented Mar 29, 2020 at 18:08
  • Nothing. I was hoping to see the spinner going until the picture loads, but it doesn't. just empty space, and then the picture shows up. I am using dev tools to cause the access to server to be slower (network, 3G slow). No errors in console. Commented Mar 30, 2020 at 19:10
  • 1
    Your code is working after adding an aspect ratio props to the v-img. Commented Mar 30, 2020 at 19:43
  • Yes! thank you, this solved this issue. Commented Mar 30, 2020 at 21:31

1 Answer 1

1

Better use 'default' slot and show it while checking @error="imgLoadStatus='error'" of image. For me, sometimes in runtime while dynamically loading and changing image, placeholder was not showing up at all.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.