Topic: Relative path in Carousel
diegoft free asked 4 years ago
Expected behavior show carousel images
Actual behavior empty
Resources (screenshots, code snippets etc.)
captionsCarousel: [
{
img: true,
src: '../../assets/images/crs2.png',
alt: 'First Slide',
caption: {
animation: 'slideInLeft',
title: 'Light mask',
text: 'First text',
},
},
{
img: true,
src: '~assets/images/crs3.png',
caption: {
animation: 'slideInDown',
title: 'Strong mask',
text: 'Second text',
},
},
{
img: true,
src: '@/assets/images/crs4.png',
caption: {
animation: 'slideInRight',
title: 'Slight mask',
text: 'Third text',
},
I have tried putting different paths like ../../assets, @/assets, ~assets and ~/assets and none of them works thanks
Magdalena Dembna staff answered 4 years ago
This relative path doesn't work as it's used from within a component inside a library. Try using require
:
{
img: true,
src: require('../../assets/logo.png'),
mask: "black-light",
alt: "First Slide",
caption: {
title: "First slide"
}
}
Best regards, Magdalena
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Free
- Premium support: No
- Technology: MDB Vue
- MDB Version: 6.7.1
- Device: Laptop
- Browser: Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: No