-
Notifications
You must be signed in to change notification settings - Fork 599
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
How to use lightgallery.js with Vue #60
Comments
Hi, I am also very keen to using lightgallery.js on a Vue application. Please provide support for Vue. |
In your vue app directory :
|
I need to learn java from the very beginning can you suggest me how can I learn faster and from where shall i start java |
@tTakia88 If what you mean is to start learning JavaScript, then I suggest you start here https://www.javascript.com/ |
I use $npm install lightgallery.js
|
<template>
<div class="app-container">
<div id="lightgallery">
<a href="https://dzine.io/products/lightgallery-wp-plugin/static/images/demo/image-6-lg.jpg">
<img src="https://dzine.io/products/lightgallery-wp-plugin/static/images/demo/thumb-6.jpg" >
</a>
<a href="https://dzine.io/products/lightgallery-wp-plugin/static/images/demo/image-12-lg.jpg">
<img src="https://dzine.io/products/lightgallery-wp-plugin/static/images/demo/thumb-12.jpg" >
</a>
</div>
</div>
</template> import 'lightgallery.js'
import 'lightgallery.js/dist/css/lightgallery.css'
export default {
name: 'IssueDetail',
data() {
return {
imageList: []
}
},
mounted() {
const el = document.getElementById('lightgallery')
window.lightGallery(el)
}
} |
I met the same problem. now I can use it. |
Hello, how can I use this with Nuxt? I got an error |
Instructions for NUXT: Install lightgallery.js and whatever relevant plugins:
in 'plugins' folde create lightgallery.client.js In the file add the following:
Now in nuxt.config.js add this:
And in your component (vue) file this:
Your gallery should now work |
Any suggestions for Vuepress 0.x? My main struggle is dealing with the similar error that dodanex posted. |
Thanks @catman85 unfortunately this only helps with setting this up in nuxt and not Vuepress. |
@VCodepp I am having the same issue that you mentioned. How did you get it working? Is there some special loader I am missing from webpack? I am importing css files from other packages fine. I am simply doing:
But I get the error you mentioned:
|
I got it working by adding this to my webpack
|
This issue has been automatically marked as stale because it has not had recent activity. If the issue is still valid for version 2.x, please re-open. Apologize for not responding on time. Thank you for your contributions. |
lightgallery on click image page refresh in nuxt how to solved? |
I have tried it with nuxt but in my case it's not working. "lightgallery.js": "^1.1.3" I have also tried with newer version of lightgallery. nuxt.config.js
lightGallery.client.js
component
i have no error message. any ideas how to solve this? |
Nothing from given answers helped me when I was setting up LightGallery with VueJS recently. I am using After dabbing with this setup longer than I should have I have finally made it work. LONG LIVE DOCUMENTATON !!! <template>
<div class="app-container">
<div id="lightgallery">
<a href="https://dzine.io/products/lightgallery-wp-plugin/static/images/demo/image-6-lg.jpg">
<img src="https://dzine.io/products/lightgallery-wp-plugin/static/images/demo/thumb-6.jpg">
</a>
<a href="https://dzine.io/products/lightgallery-wp-plugin/static/images/demo/image-12-lg.jpg">
<img src="https://dzine.io/products/lightgallery-wp-plugin/static/images/demo/thumb-12.jpg">
</a>
</div>
</div>
</template> import lightGallery from 'lightgallery';
// Plugins
import lgThumbnail from 'lightgallery/plugins/thumbnail'
import lgZoom from 'lightgallery/plugins/zoom'
export default {
name: 'ArticleImages',
data() {
return {
imageList: []
}
},
mounted() {
lightGallery(document.getElementById('lightgallery'), {
plugins: [lgZoom, lgThumbnail],
// licenseKey: 'your_license_key'
speed: 500,
// ... other settings
});
}
} |
Any way to get this to work with Nuxt 3? the current nuxt solution is for nuxt 2 both that and the normal installation does not work for nuxt 3. -- EDIT because I got it to work in Nuxt 3 -- For anybody stuck with this: example markup:
and use this script:
Hope this helps somebody |
@maxvanweenen I tried it with nuxt-bridge and get the error
Probably because of the If I comment it out and try the lightgallery it errors out with a
|
I'm getting |
The project seems to be dead. |
Thanks @MartinX3 , but i want to implement image gallery in my project |
Hi, how can I use plugins such as lgZoom and lgThumbnail in Nuxtjs 2.15.8 |
Hi 1- you should install the package via npm or yarn normally
3- simple template usage
4- import css in your scoped style
i hope it will help anyone struggling with this and Nuxt 3 |
You are just amazing! I've struggled for a whole week with this. Thanks, now am good to go. |
No description provided.
The text was updated successfully, but these errors were encountered: