[Vuejs]-How to get type of functions which return object

1👍

To get fields of an object, you can use Object.keys(your_object) or Object.entries(your_object). This should work even when you are getting your types dynamically from the Pinia Store.

Example:

const obj = {a: 1, b: "Hello"} 
Object.entries(obj)
// [[ "a", 1 ], [ "b", "Hello" ]]

Leave a comment