menu

Questions & Answers

How to display a Dictionary in a q-table?

following classes in backend:

public class person {
    public DateTime logInDate { get; set; } // key
    public string Name { get; set; }
    public string Pet { get; set; }
    public int Age { get; set; }
}
public class personList {
    List<person> listOfPerson
}

following Dictionary in frontend:

pers: {} as { [p: string]: person[] }

key => Date

I want to display it in an expandable table.

I tried

<q-td v-for="(value, key, index) in person" :key="`${ key }-${ index }`">
   {{ value }} 
</q-td>

but it threw an error

How can I display a dictionary in a quasar table?

Appreciate any help 🙏

Comments:
2023-01-20 23:20:02
What error does it throws ?
2023-01-20 23:20:02
And can you please show a minimal reproducible example ?
Answers(0) :