Comments (2)
Hi @isaumya, thanks for your feedback.
There is no particular thing to do to make it work.
Just follow the instructions from the documentation, you don't even need to place Vueper Slides into an SSR tag.
It will work just as the examples are written in the documentation.
Please reopen if you have troubles with a particular case.
Cheers
from vueper-slides.
Hi @isaumya,
I have just tried it again on Nuxt 2 after the V2 release, there 's nothing particular to do to use Vueper Slides.
This is how I have it working:
- Import the lib and CSS in your component according to the documentation:
import { VueperSlides, VueperSlide } from 'vueperslides'
import 'vueperslides/dist/vueperslides.css'
You could also create a plugin for Vueper Slides but that's optional.
- Add the components to use in the template:
components: { VueperSlides, VueperSlide },
- Use the Vueper Slides normally like in the documentation, without the
no-ssr
tag.
<vueper-slides>
<vueper-slide v-for="(slide, i) in slides" :key="i" :title="slide.title"></vueper-slide>
</vueper-slide>
If you use images, and they are in the assets folder, Webpack has to import them with the hash, so you need to require them, this is a way to do it:
<vueper-slide v-for="(slide, i) in slides" :key="i" :title="slide.title" :image="getImage(slide.image)"></vueper-slide>
methods: {
getImage (name) {
return require(`../assets/images/${name}`)
}
}
The last thing you need is a correct publicPath
in the build
in nuxt.config.js
:
...
build: {
publicPath: '/your-final-url-root/'
}
...
And you might need that for the router as well:
router: {
base: '/your-final-url-root/'
}
The public path and router base is only for the final build after npm run build
and npm run generate
, it should work fine on dev server.
Hope it helps.
from vueper-slides.
Related Issues (20)
- Drag not working on Chrome/Brave & Chrome IOS HOT 6
- Vueperslides in Astro Build issue HOT 1
- Slide show does not show all images when using require() keyword HOT 1
- Autoplay not working HOT 1
- Click and slide - unexpected behavior
- Using vue3 for Multiple slide when on last slide it does not slide if click Prev
- error <template #content > typescript - error TS2339: Property 'content' does not exist on type '{}'. HOT 1
- Idea for auto height HOT 1
- Feature Request: vertical thumbnails
- Cannot drag if initialized with no slide
- How to display multiple items but move the items one by one with each next click? HOT 2
- On-Key
- On-Key is not working on load HOT 1
- Question about 'lazy' and 'lazy-load-on-drag'
- render issues with template #content and multiple images HOT 1
- more then 3 or 4 visible slides. active slide issue when move one by one slide
- Events not emitting properly on 3.5.1 HOT 1
- ASYNCHRONOUS COMPONENT USE ERROR
- href="false" in vueperslide is causing nuxt Prerendering crawler to fail.
- how the bullets dynamically update as the user navigates through the slides.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vueper-slides.