innovative Vue carousel that dynamically displays data

The carousel is having trouble displaying data from the database

Although data has been successfully retrieved from the database, it is not appearing in the UI

<b-row>
                    <div class="card-carousel-wrapper">
                        <div class="card-carousel--nav__left" v-on:click="moveCarousel(-1)" :disable="atHeadOfList"></div>
                        <div class="card-carousel">
                            <div class="card-carousel--overflow-container">
                                <div class="card-carousel-cards" :style="{transform:'translateX'+'('+currentOffset+'px'+')'}">
                                    <div class="card-carousel-card" :v-for="field in fieldlist">
                                        <div class="card-carousel--card-header">{{fieldlist.value}}</div>
                                        <div class="card-carousel--card"  :v-for="schedule in schedulelist">
                                            <div class="btn button" :class="classStatus()" v-on:click="classStatus(3)" :disable="disableButton(2)">{{schedulelist.start_time}}-{{schedulelist.end_time}}</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="card-carousel--nav__right" v-on:click="moveCarousel(1)" :disable="atEndOfList"></div>
                    </div>
                </b-row>
<script>

            loadSchedule(){
                axios({
                    url: 'bookings/schedule/list/',
                    method:'PUT',
                    data:{
                        id_field:this.selectedField
                    }
                }).then(response=>{
                    this.schedulelist = response.data.serve
                }).catch(error=>{
                    console.log(error);                    
                });
            },
loadLocation(){
                let index=0;
                axios({
                    url: '/location',
                    methods:'GET',
                }).then(response=>{
                    this.locationList = response.data.serve
                    for (index=0; index< this.locationList.length; index++) {
                        this.location.push({value: this.locationList[index].id_location, text: this.locationList[index].location_name})
                    }
                    console.log(this.location);
                }).catch(error=>{
                    console.log(error);
                })
            },
            loadField(){
                let index=0;
                axios({
                    url: '/field/data/'+this.selectedLocation,
                    methods:'GET',
                }).then(response=>{
                    console.log(response);

                    this.fieldlist = response.data.serve
                    this.field = []
                    for (index=0; index< this.fieldlist.length; index++) {
                        this.field.push({value: this.fieldlist[index].id_field, text: this.fieldlist[index].field_name})
                    }                    
                }).catch(error=>{
                    console.log(error);
                })
            },
</script>

The headers on the card display data from the loadfield results, while the buttons on the card display data from the loadschedule results

Answer №1

Consider removing the colon sign : from the v-for directive. By default, the directives are bound to your properties:

  <div class="card-carousel-card" v-for="field in fieldlist">
                                    <div class="card-carousel--card-header">{{fieldlist.value}}</div>
                                    <div class="card-carousel--card"  v-for="schedule in schedulelist">
                                        <div class="btn button" :class="classStatus()" v-on:click="classStatus(3)" :disable="disableButton(2)">{{schedulelist.start_time}}-{{schedulelist.end_time}}</div>
                                    </div>
                                </div>

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

What could be causing the partial to not load JavaScript properly?

Hello, I am a newcomer to Angular and I'm currently working on implementing the slick carousel. It functions properly on the index page, but when I try to use the same HTML in a partial and include it with ng-view, it doesn't work as expected. T ...

What are the advantages of polymer's inter-component data binding?

I am working on a login component and I want to ensure that the login status is accessible by other components within my application. Is there anyone who can share some functional code snippets or examples? I require a method for binding or event handlin ...

Unable to establish API connection in node.js

As a novice, I recently delved into the world of APIs using node.js. My goal was to fetch data from a simple API for practice. This venture is just an experiment and any assistance or guidance on connecting to APIs, especially those requiring an API key, ...

Node.js: retrieving a webpage and waiting for it to load before extracting data

Is it possible to scrape a webpage using just node.js without relying on other libraries like phantom.js? That is the question I have been pondering lately. In my code below, I am requesting a webpage with request and then using cheerio to extract data by ...

The addition of a cancel swipe feature to an HTML5 eBook is causing the text input field for note-taking to malfunction

I am currently working on the development of a process to create HTML5 based eBooks for both desktop and mobile use using Adobe InDesign and exporting them with a plugin called In5. This plugin allows for the incorporation of html, css, and javascript duri ...

Trouble arising from PHP's encoded array

I am encountering an issue with retrieving a value from PHP and passing it to Javascript. The PHP array is encoded like this : echo json_encode($myArray); On the Javascript side, I use the following code within the $.ajax method: success:function (data) ...

Angular directive specifically meant for the parent element

I am working on a directive that I need to apply to a specific div element without affecting its child elements. The goal is to make the main div draggable, so that when it moves, its child divs move along with it. However, I do not want the child divs to ...

Error handling in Mongoose callback functions

Currently, I am delving into nodejs, express and mongoose. A question has arisen in my mind regarding the findOne function used to fetch a document from the database. Typically, it is utilized like this: Product.findOne({_id: req.params.id},function(erro ...

Create a visual representation of an image by sketching a detailed line profile using HTML5's

I am attempting to create an intensity profile for an image, using the x-axis as the line's length on the image and the y-axis as the intensity values along the length of the line. How can I achieve this on an HTML5 canvas? I have tried the code below ...

Creating a Wireframe in Three.js Using a RawShaderMaterial with LineSegments

In the midst of my work on a project, I encountered a dilemma with rendering an intricate wireframe using THREE.LineSegments. My objective is to gradually animate the vertices within this LineSegments material (referred to as warehouse in the project), but ...

MUI Tutorial: Displaying Text with Line Breaks

Whenever I input text into the MUI Textfield, it displays without any line breaks. Is there a more effective solution available? <Stack direction="row" alignItems="start" justifyContent="start" mb={5}> <TextFie ...

Circular reference in Angular/TypeScript

I encountered a circular dependency issue in my Angular project and tried various solutions, including exporting all dependent classes from a "single file" as suggested here. Unfortunately, this approach did not work for me. I then explored other solutions ...

"Exploring the dynamic duo of Angular2 and ng2Material

I am currently facing an issue with the styling in my code while using ng2Material with Angular2. First: A demonstration of Material style functioning properly can be seen in this plunker. When you click on the button, you will notice an animation effect. ...

Bottom-aligning text in Tailwind CSS

Creating two <p> tags to store text: <p v-if="my_property <= 0" class="text-green-500 text-lg font-bold">{{Math.abs(my_value)}}%</p> <p v-else class="text-red-500 text-lg font-bold">{{my_value}}%< ...

It is impossible for Javascript to access an input element within a gridview

I have developed an asp.net page that allows a site administrator to select a user as the 'systems chair'. The page displays users in a gridview and includes a column of radio buttons to indicate who the current chair is or to change the assigned ...

Develop a descriptive box for a radio button form using jQuery

I am working on creating a form with simple yes/no questions. If the answer is no, no explanation is needed. However, if the answer is yes, I want to insert a new table row and display a textarea for an explanation. To ensure data validation, I am utilizi ...

The main source for loading the 'XYZComponent' cannot be located

There's an issue I'm facing where ng2 code is being loaded into a .Net MVC component, but the console is showing the following error: EXCEPTION: Uncaught (in promise): Error: Cannot find primary outlet to load 'UsersComponent' Error: C ...

Is it possible for Webpack's DefinePlugin.runtimeValue to access the module's entry point?

https://i.sstatic.net/D0XMT.png Similar to this, I am looking to utilize the DefinePlugin in order to define a global variable ECZN for my application using the Webpack runtimeValue. Additionally, the WebpackModuleInfo is retrieved from the file where I ...

What is the best way to incorporate CDN into my webpack build process?

I have developed a module with the following code: export default () => console.log('hello my_module~!') The configuration in the webpack.config.js file looks like this: module.exports = { // ... output: { // ... library: 'he ...

Encountering an undefined response in API call using Fetch with Express Nuxt

I've hit a roadblock with a task involving Express, API, and Fetch. I'm utilizing Nuxt along with Shopify API endpoints to retrieve data such as orders. Below is my express API Endpoint which should return an array of objects (orders). const bod ...