Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Thumbs are loaded as full size images #31

Open
Head opened this issue Apr 8, 2020 · 3 comments
Open

Thumbs are loaded as full size images #31

Head opened this issue Apr 8, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@Head
Copy link

Head commented Apr 8, 2020

Hi,

would be awesome if you can add a thumbs property so that I can define thumbnails instead of full images.

@normansander
Copy link
Contributor

Hi,

would be awesome if you can add a thumbs property so that I can define thumbnails instead of full images.

Hi @Head , I think you're absolutely right and I also had something in mind. Thanks for the hint. At the moment I'm busy with other projects but will come back to this problem asap.

@normansander normansander added the enhancement New feature or request label Aug 12, 2020
@jijojames18
Copy link
Contributor

jijojames18 commented Aug 15, 2020

@headione
Thanks for this wonderful library.

From my understanding, the library already has most of the support required for implementing this.
Prop images accepts an array of strings as well as an array of objects and will use the value of url for displaying the image and thumbnails. I suggest a new property thumb inside each image object. The full image will be shown based on url property and if thumb property is present, it will be used for thumbnails else the url property will be used. Please let me know if you are thinking of a better approach and I would be open to raising a PR for this issue.

@IgorKlajo
Copy link

IgorKlajo commented Oct 9, 2020

Hi,

would be awesome if you can add a thumbs property so that I can define thumbnails instead of full images.

For HTML you can use something like this

<img class="image" v-for="(thumb, i) in thumbs" :src="thumb" :key="i" @click="index = i">

and in data you add

thumbs: [ 'path to thumbnail1, 'path to thumbnail2, ],

In case you want to add alt text to your thumbnails, but for some reason you don't see the thumbnail ( get an [object Object] for src instead of the image path, you'll need to change the HTML code a little bit.

<img class="image" v-for="(thumb, i) in thumbs" :src="thumb.url" :key="i" @click="index = i" :alt="thumb.alt" >

and in data would be

thumbs: [ { url: 'path to thumbnail1', alt:'My alt text' }, { url: 'path to thumbnail2', alt:'My alt text' }, ],

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants