Open thetestcoder opened 4 years ago
@thetestcoder - I had a similar issue, but for me it was because of the missing/incorrectly mapped height and width parameters. Once I fixed that, the images showed correctly.
Here is how I implemented it:
<template>
<div class="containter">
<VueJustifiedLayout :items="images" v-slot="{ item }" :options="justifiedOptions">
<img :src="item.url" />
</VueJustifiedLayout>
</div>
</template>
export default {
data() {
return {
images: [],
justifiedOptions: {
},
}
},
mounted() {
fetch('/api/image-search')
.then(response => response.json())
.then(response => {
var search_images = JSON.parse(response.data);
search_images.forEach(element => {
this.images.push({
width: element.WIDTH,
height: element.HEIGHT,
url: 'http://example.com' + element.URL,
});
});
});
},
}
<style>
.justified-item img {
max-width: 100%;
}
</style>
i added this package as plugin in Nuxtjs. I follow documentation but i not get desire result
this is what i get
this is what is want
Plugin -
nuxt config
main File Where i used it
Nuxtjs Version