Vue.js:如何更新对象数组?

Vue.js:如何更新对象数组?,vue.js,vuejs2,Vue.js,Vuejs2,我正在尝试更新Vue.js中的对象数组。当尝试更新位置的值时,我正在努力更新数组中的对象 当我注销对象时,我得到以下信息: console.log(this.location) // {…} console.log(this.location.additionalProperties); // [{…}, __ob__: Observer] console.log(this.location.additionalProperties.integrations); // undefined

我正在尝试更新Vue.js中的对象数组。当尝试更新位置的值时,我正在努力更新数组中的对象

当我注销对象时,我得到以下信息:

console.log(this.location) // {…}

console.log(this.location.additionalProperties);  // [{…}, __ob__: Observer]

console.log(this.location.additionalProperties.integrations);  // undefined
我的
additionalProperties
对象如下所示:

"additionalProperties": [
    {
      "integrations": [
        {
           "foo": {
               "locationId": 123,
               "example": "bar",
               ...
           }
        }
      ]
    }
],
location: {
    type: Object,
    required: true,
    default: () => ({}),
},
this.location.additionalProperties.integrations.foo = {
   locationId: 456,
   example: "testing",
   somethingElse: "anotherValue"
}
我正在传递我的
位置
,作为如下道具:

"additionalProperties": [
    {
      "integrations": [
        {
           "foo": {
               "locationId": 123,
               "example": "bar",
               ...
           }
        }
      ]
    }
],
location: {
    type: Object,
    required: true,
    default: () => ({}),
},
this.location.additionalProperties.integrations.foo = {
   locationId: 456,
   example: "testing",
   somethingElse: "anotherValue"
}
我知道我正在正确地传递位置。我相信这是一个我正在努力解决的语法问题。我正在尝试将我的
foo
对象设置为如下内容:

"additionalProperties": [
    {
      "integrations": [
        {
           "foo": {
               "locationId": 123,
               "example": "bar",
               ...
           }
        }
      ]
    }
],
location: {
    type: Object,
    required: true,
    default: () => ({}),
},
this.location.additionalProperties.integrations.foo = {
   locationId: 456,
   example: "testing",
   somethingElse: "anotherValue"
}
使用上述方法,我将得到一个版本的
无法设置未定义的foo
。如何更新
additionalProperties
数组中的对象


谢谢你的建议

additionalProperties是一个数组

“附加属性”:[
{
“整合”:[
{
“foo”:{
“locationId”:123,
“示例”:“条”,
...
}
}
]
}
],
this.location.additionalProperties[0]。integrations.foo=…