有谁知道如何从 Object 数据类型创建新列?我怎么能做到呢?下面是我的设置和数据的代码,以便更清楚地理解提前致谢!私人设置 = {
columns: {
firstName: {
title: 'First name',
type: 'text'
},
lastName: {
title: 'Last name',
type: 'text'
},
userType: {
// This is correct way only when there is string in response from API named - userType
// But when I'm trying to type something like - userType.value i get an error
title: 'User type',
type: 'text'
},
}
来自 API 的数据:
.......
{
firstName: 'Jacob',
lastName: '',
middleName: '',
userType: {value: 'superAdmin', display: 'Super Administrator'},
login: '',
password: '',
phoneNumber: '066-233-77-34',
city: 'Rome',
address: 'someStreet',
salary: '0',
},
......