Images are not being shown by Glide JS

I have implemented the Glide JS carousel within a VueJS project to showcase multiple images, however, I am encountering an issue where only the first image is being displayed. The <img/> tag has the correct src URL for all three images, but only the initial one is showing up. I have spent hours debugging this problem without any success in identifying the cause of this bug.

    import Glide from "@glidejs/glide";
import FeatherIcon from "vue-feather";
import "./_style.scss";

export default {
  name: "DashboardCarousel",
  props: {
    imageSources: Array
  },
  mounted() {
    new Glide(".glide").mount();
  },
  render(h) {
    return (
      <div class="glide">
        <div class="glide__track" data-glide-el="track">
          <ul class="glide__slides">
            {this.imageSources.map((source, key) => (
              <li
                key={key}
                class="glide__slide glide__frame glide__image-area"
                class={`glide__slide slide-${key}  glide__image-area`}
              >
                <img
                  onClick={() => window.open(source.link)}
                  src={source.path}
                  style={{ width: "100%", cursor: "default" }}
                />
              </li>
            ))}
          </ul>
        </div>
        <div class="glide__arrows" data-glide-el="controls">
          <button class="glide__arrow glide__arrow--left" data-glide-dir="<">
            <FeatherIcon
              type="chevron-left"
              size={48}
              style={{ opacity: 0.5 }}
            />
          </button>
          <button class="glide__arrow glide__arrow--right" data-glide-dir=">">
            <FeatherIcon
              type="chevron-right"
              size={48}
              style={{ opacity: 0.5 }}
            />
          </button>
        </div>
        <div class="glide__bullets" data-glide-el="controls[nav]">
          {this.imageSources.map((source, index) => (
            <button class="glide__bullet" data-glide-dir=`=${index}`></button>
          ))}
        </div>
      </div>
    );
  }
};

Answer №1

Uncovered resolution: The issue arose when my image data loaded after glidejs had already been rendered. Since Glide JS retrieved these images from static props, they remained unchanged even after the parent component was updated (at least, that's my hypothesis).

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Solving the Challenge of URL Issue in Ajax Call to MVC Controller

I have searched extensively for a solution to my jQuery/MVC problem, but haven't found one that works. Here is the JavaScript code I am using: $.ajax({ type: "POST", url: '@Url.Action("Search","Controller")& ...

White border appears when hovering over MUI TextField

I've been troubleshooting this issue for what seems like an eternity. I've combed through Chrome's inspect tool, searching for any hover styles on the fieldset element, but to no avail. Here's my dilemma... I simply want a basic outline ...

A guide on utilizing nodejs to automatically open the default browser and direct it to a specific web address

I am currently developing a program using Node.js. One of the features I aim to implement is the ability to launch the default web browser and direct it to a particular URL. I want this functionality to be compatible across Windows, Mac, and Linux operat ...

AngularJS dynamically creates an HTML template that includes an `ng-click` attribute calling a function with an argument

Struggling to create an HTML template using an AngularJS directive, the issue arises when trying to pass an object into a function within one of the generated elements. Here is the directive code in question: app.directive('listObject', function ...

Creating a reusable anonymous self-invoking function

Here is a function that I am working with: (function(e, t) { var n = function() { //code, code, code }; //code, code, code e.fn.unslider = function(t) { //code, code, code }; })(jQuery, false) To execute this function, I have impleme ...

Sorting and filtering data using AngularJS filter and orderBy inside a controller or factory

I am currently working with a factory that looks like this: app.factory("ModuleFactory", function (api, $http, $q, filterFilter) { var moduleList = []; var categoryList = []; var moduleTypeList = []; var academyModuleTypeList = []; var mostUsed = []; var ...

Utilizing URL Parameters and Query Strings in React Router: A Comprehensive Guide

Can someone help me retrieve the foo parameter value from http://localhost:3000/params?foo=123? I keep encountering an error message: Error: Params(...): No render output was returned. This typically indicates a missing return statement or returning null ...

Decode the JSON serialized format generated by CircularJSON

I have a JSON object in my node.js code that contains circular references. To send this information to the browser, I utilized the NPM package circular-json to stringify the object and serialize the circular references: var CircularJSON = require("circula ...

Issue with React-Toastify not displaying on the screen

After updating from React-Toastify version 7.0.3 to 9.0.3, I encountered an issue where notifications are not rendering at all. Here are the steps I followed: yarn add [email protected] Modified Notification file import React from "react" ...

Creating a javascript function to update content on click

Recently, I've been designing a webpage and encountered an issue. I want the text in a specific area to change whenever a user clicks on a link. Below is the code snippet related to the section I want to modify using a JavaScript function. <div id ...

Listening for Events from Child Components in Vue.js

I am struggling to figure out how to send an event from a child component to its parent in order to change the view. Although I have been able to create and emit the event, my template does not seem to be properly registering it. I am working with Single ...

Unable to display values in Fusion Charts zoomline chart using the showValues chart property

I'm struggling to figure out how to display the data plot values with showValues: '1' in a zoomline chart using Fusion Charts. You can see and test it on this fiddle: http://jsfiddle.net/60oeahc1/4/ Is there a way to make this feature work ...

What exactly are Node.js core files?

I recently set up my Node.js application directory and noticed a presence of several core.* files. I am curious about their purpose - can these files be safely removed? The setup involves installing Node.js alongside Apache using mod_proxy to host one of ...

Resolve the conflict with the upstream dependency when installing NPM packages

I'm encountering an issue while attempting to npm install vue-mapbox mapbox-gl - I keep getting a dependency tree error. Just to provide some context, I am utilizing Nuxt.js SSR with Vuetify and have not installed anything related to Mapbox before ru ...

Utilizing AngularJS for Your Business Website

We are in the process of developing a new commercial website to replace our current one. Concerns about performance are on our minds. The amount of data we have per page is not very heavy, with a maximum of 150 data binds. We plan to use AngularJS 1.2 t ...

What is the best way to showcase the reading from a stopwatch on my screen?

Working on these codes has been quite a challenge for me. I have recently embarked on a JavaScript journey as a beginner and attempted to create a stopwatch project. However, it seems like I may have missed the mark with the logic or implementation somewhe ...

Top method for identifying browser window modifications such as navigating back, altering the URL, refreshing, or closing the window

Currently, I am developing a testing application that requires me to trigger a finsihTheTest() function in specific situations. These situations include: When the user attempts to reload the page. When the user tries to navigate back from the page. If the ...

Which symbol or character corresponds to the public "get symbol" method?

While going through some Typescript code, I came across a line that is giving me trouble to understand. const symbol = Symbol.for('symbolname'); class Something { public get [symbol]() { return true; } ... } I am confused abou ...

What is the best way to create a Snap.svg map using AngularJS?

I am in the process of creating a web interface for an online board game. My goal is to load a Snap.svg map using Snap.load asynchronously. Once the map is loaded, I intend to attach a watch to a scope property and apply colors to the map based on that pr ...

An unidentified non-space character appeared following the JSON data on line 1, which was unexpected and at column

I am currently working on a WordPress site locally and my goal is to develop a hybrid app for it using AngularJS. Within WordPress, I have created a plugin to retrieve data. The metadata comes in the form of an array: (...) After converting this complex ...