我正在与Sequelize合作,经过多次尝试进行内部加入后,我取得了不错的成绩:
{
"success": false,
"message": "Query not successful, the result was empty",
"data": {
"codWO": "1016285246",
"codType": "01",
"origin": "1016285246--origin",
"solution": "1016285246--solution",
"consecuence": "1016285246--consecuence",
"actions": "1016285246--actions",
"hours_stopped": 20.5,
"failureState": "1016285246--failureState",
"failureEquipment": "1016285246--failureEquipment",
"failureEffect": "1016285246--failureEffect",
"failureCause": "1016285246--failureCause",
"wo_cor_type.name": "Emergency Repair",
"wo_cor_type.description": "Urgent repairs such as a broken device that avoid running the test.",
"wo_cor_type.codType": "01"
}
}
我可以读取除最后一棵树之外的所有变量,因为它们有点数。
我怎样才能读到这种变量?
vm.woCorrective = data.data;
console.log(data.success);
console.log(vm.woCorrective);
console.log(vm.woCorrective.codWO);
console.log(vm.woCorrective.solution);
console.log(vm.woCorrective.failureCause);
// console.log(vm.woCorrective.[('wo_cor_type.name')]);
答案 0 :(得分:0)
试试这个:
console.log(vm.woCorrective["wo_cor_type.name"]);
console.log(vm.woCorrective["wo_cor_type.description"]);
console.log(vm.woCorrective["wo_cor_type.codType"]);