Working with vue 3 reactive data.

Working with vue 3 reactive data.

draw134draw134 Posts: 12Questions: 4Answers: 0

Hi. I can someone help me why my data is not showing on the datatable? Currently I implemented it like this


const { users } = defineProps({ users: Array })

in my table I have something like

                        <DataTable :data="users" class="display" ref="table">
                            <thead>
                                <tr>
                                    <th>Email</th>
                                    <th>Program</th>
                                    .....
                                </tr>
                            </thead>
                        </DataTable>

but when I look the props in vue devtools its

users:Array[2]
0:Reactive
1:Reactive

I got an warning

DataTables warning: table id=DataTables_Table_1 - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4

Answers

  • draw134draw134 Posts: 12Questions: 4Answers: 0

    My users props is

    users:Array[2]
    0:Reactive
    id:3
    id_number:"12345"
    course_id:1
    phone_number:"09123456781"
    name:"Student One"
    
  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Have you followed the diagnostic steps in the technical note that the error refers to? That would be the place to start.

    Colin

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Also link to a test case showing the issue would be useful as would the full code, since I don't see your DataTables configuration there.

    Allan

Sign In or Register to comment.