I'm beginner and I currently learn vue.js. I try to create a carousel slider but I can't get my images from the assets folder. I don't find any solution that it helps me to solve the problem. Can anyone help me, why I don't see on the site?
<template> <div class="container"> <div class="title">Projects</div> <Carousel class="carousel"> <Slide v-for="(slide, index) in carouselSlide" :key="index"> <div class="slide-info"> <img :src="require(`../assets/${slide}.jpg`)" /> </div> </Slide> </Carousel> </div> </template> <script> import Carousel from "../utility-components/Carousel.vue"; import Slide from "../utility-components/Slide.vue"; export default { setup() { const carouselSlide = ["bg-1", "bg-2", "bg-3"]; return carouselSlide; }, components: { Carousel, Slide }, }; </script>
/publicand just import them as normal, e.g.src="/my-img.png"{ carouselSlide }notcarouselSlide