Data not displaying in Vuetify table

Can someone help me with a table display issue in Vuetify? I've tried various solutions but my data is not showing up on the table, although I can see it using the dev tools.

Here's a screenshot of how the data looks in the dev tool

I've shared my code below:

Vuetify Table Code

BoardList.vue

<template>
  <v-container>
    <v-data-table
      :headers="headers"
      :items="boards"
      class="elevation-1"
      :search="search"
    >
      <template v-slot:item="props">
        <td class="text-xs-right">{{ props.item.articleno }}</td>
        <td class="text-xs-right">{{ props.item.data.articleno }}</td>
      </template>
    </v-data-table>
    <v-col><v-col md="8" /></v-col>
    <v-container>
      <v-row>
        <v-col md="6" />
        <v-btn @click="goodbye"> 게시글 삭제</v-btn>
      </v-row>
    </v-container>
  </v-container>
</template>

...

I've tried different combinations like props.item.articleno, props.item.data.articleno, item.articleno, and item.data.articleno, but none seem to be working. My Vue version is 2.6.11. Can anyone point out what I might be doing wrong?

Answer №1

It seems like there may be an issue with the number of items being passed in the listArticle method.

The correct way to call it is:

listArticle(param, (response) => {}, (error) => {});

If the items in the response.data do not have a data property as referenced in props.item.data.articleno, this could result in errors when trying to access nested values and cause display issues.

Some suggestions for troubleshooting:

  • Ensure that the two <td> elements are wrapped inside a <tr> element
  • Consider deconstructing v-slot props to avoid referencing them as props.item
<template v-slot:item="{ item }">
  <tr>
    <td class="text-xs-right">{{ item.articleno }}</td> // should work
    <td class="text-xs-right">{{ item.data.articleno }}</td> // might not work
  </tr>
</template>

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

Guide to creating dynamic borders around your PHPexcel output

Looking for assistance on adding borders around output arrays in an Excel report using PHPexcel. I reviewed the documentation, but the examples are static, requiring a predefined number to set. My goal is to have all arrays transferred to Excel with bord ...

Using react-select to display "N items selected" instead of listing out all the selected items

Exploring the potential of react-select as a city-picker selector for users to choose one or multiple cities to filter data. Take a look at how it appears on my page: The list of cities may be extensive, and I am concerned about the selector expanding bey ...

JavaScript/AJAX Functionality Only Operates Correctly During Debugging

I am currently facing an issue with dynamically populating a website. The code works perfectly when I step through it, but it fails to work as intended on page load. Here is the relevant code snippet: <body onload="populate_all(string)";> function ...

What could be the reason for the email not being displayed in the form?

I am attempting to automatically populate the user's email in a form when a button is clicked, preferably when the page is loaded. However, I am encountering issues with this process. This project is being developed using Google Apps Script. Code.gs ...

Stop the loop in cypress

We have a certain situation as outlined below loop through all name elements on the webpage if(name.text() matches expName) { name.click() break out of the loop } else { createName() } How can I achieve this in Cypress? Using return false doesn't se ...

Can Child Component Changes in React Checkbox Cause Parent Node to Re-Renders?

Struggling with creating checkboxes for my project, I've spent an entire day on it without finding a solution. The issue involves a main checkbox that controls all child checkboxes. The desired functionality is to have the parent node's "allChec ...

Having trouble displaying the time in the middle square when pressing TouchableOpacity in React Native?

Having trouble pressing the TouchableOpacity button as it's not responding, and even after pressing it, I need to access the time picker to select a specific time to display inside the square view in the center. Any suggestions on how to resolve this ...

Update WooCommerce Mini-cart with ajax refresh

I'm having an issue with my custom plugin where everything is working properly, except for the fact that the mini cart is not updating after adding items. I have tried various methods to trigger a refresh, but so far nothing has worked. Below is a sni ...

The function $.post(...) is failing to detect the JSON content in the

I am attempting to send a POST request to the server using the following code: var body = { PatientAgeFilter: { CompareOperator: parseInt(self.patientAge()), MoreThanVal: { AgeSpecifier: 0, AgeValue: parseInt(se ...

Is there a way to duplicate items similar to MS Word by using a combination of ctrl + mouse click +

In my fabricjs application, I currently clone an object by clicking ctrl + left mouse click on it, which works fine. However, I would like to be able to clone the object in a similar way to MS WORD, by using ctrl + click + drag. Has anyone achieved this f ...

Comparing Pinia and useState() in Nuxt 3

Choosing Between Store (Pinia) and UseState When it comes to deciding between useState and a store like Pinia, the question arises - can useState replace any store such as Pinia? With useState allowing ref sharing across all components, determining whethe ...

Guide: Exchanging choices using jQuery and Address plugin

I am trying to find a way to exchange the values of two options with each other. I created a simple fiddle that successfully swaps input values, but when I tried it with select options, it didn't work as expected. The approach I'm using is based ...

Tips for utilizing code submitted by a user to extract meaningful errors

As I work on developing a mod for the online game Cookie Clicker, I've implemented a feature that allows users to input their own code to enhance the functionality of my mod. However, before users save their code using my custom editor, I want to run ...

Alignment of the table with a fixed header and scrollable body

Currently, I am experiencing an issue with aligning a table. My aim is to have a fixed header and a scrollable body for the table. To do this, I have aligned the table header and body using: display: table-header-group For the table body, I have applied ...

Learn the best way to utilize a stylus in Vue files to interact with JavaScript variables

For instance: <script> export default { data() { return{ varinjs: 1, } } } </script> <style lang="stylus"> varincss = varinjs body if varincss == 0 ba ...

Unable to locate the class org.json.JSONObject within my Java RESTful web service, resulting in a java.lang.Class

While working on a Java restful webservice to retrieve data as a JSON Object, I encountered an error below: java.lang.NoClassDefFoundError: org/json/JSONObject ... (error message continues) Here is the code snippet where the error occurred. I have al ...

Utilizing JSON data files in Java programming

I'm facing an issue with reading JSON files. For some reason, I am unable to read files from the portblock, but can successfully read from the webblock. Here's the content of test.json: { "webblock" : ["www.google.com", "www.youtube.com", " ...

I encountered difficulties rendering a VueJS component after incorporating the Argon Dashboard for Laravel into my project

I have a project that is currently active and all the VueJS components within it are functioning properly. However, after installing the Argon Dashboard for Laravel into my Laravel project, I am having an issue where my VueJs Components are not displayin ...

Changing the value of a ref in Vue 3 within a function

I need to change the value of 'reset' from true to false when a file is uploaded. Even though 'reset' is externally set to true, it should be changed to false during file upload process. How can this be achieved? <template> rese ...

Transforming Pandas Dataframe into JSON Format

I have data stored in a pandas dataframe that I need to convert into JSON format. Here is an example of the data: data = {'Product':['A', 'B', 'A'], 'Zone':['E/A', 'A/N', 'E ...