interface Activity {
id: string,
title: string,
body: string,
json: Object
}
私は現在の操作を行います。
headers: Array<Object> = [
{ text: 'id', value: 'id' },
{ text: 'title', value: 'title' },
{ text: 'body', value: 'body' },
{ text: 'json', value: 'json' }
]
これは非常に反復取得します。私が希望することは、このようなものです:
headers: Array<Object> = Activity.keys.map(key => {
return { text: key, value: key }
})