Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
Vue.js slider with local image doesn't work

Hi i find this image slider for Vue.js on "digitalocean.com" but works only with image uploaded on (imgbb, pixabay, etc). i try to set with local image (on assets) but doesn't work, some one can help me? i already tried with ../assets/castelgandolfo.jpg or ./assets/castelgandolfo.jpg sorry for my english!

This is the code:

export default {
  name: "Slider",
  data() {
    return {
      images: [
        "https://i.ibb.co/6NJ7p6w/Castelgandolfo.jpg",
        "https://i.ibb.co/QJN06cG/Grottaferrata.jpg",
        "https://i.ibb.co/R3pHtGx/Ariccia.jpg",
      ],
      timer: null,
      currentIndex: 0
    };
  },

  mounted: function() {
    this.startSlide();
  },

  methods: {
    startSlide: function() {
      this.timer = setInterval(this.next, 10000);
    },

    next: function() {
      this.currentIndex += 1;
    },
    prev: function() {
      this.currentIndex -= 1;
    }
  },

  computed: {
    currentImg: function() {
      return this.images[Math.abs(this.currentIndex) % this.images.length];
    }
  }
};

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can refer images directly using '@'

Example:

<img src="@/assets/images/home.png"/>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!