To solve, under VUE, why is app.items [0] ['name'] =' Xmurman 'responsive after setting the value?

var vm = new Vue({
  data: {
    items: ["a", "b", "c"]
  }
})
vm.items[1] = "x" // 
vm.items.length = 2 // 

the official website does not mean that vm.items [1] ="x"is not responsive
the tests are as follows:

<script>
var app = new Vue({
        el: "-sharpapp",
        data: {
            english: ["a", "b", "c"],
            items: [{
                name: "",
                age:18,
            },{
                name: "",
                age:18,
            },{
                name: "",
                age:18,
            }]
        },
        methods: {
            dianji:function(){
                console.log("")
                //app.english[0]="X-man"
                app.items[0]["name"] = "X-man"
            }
        },
        created: function () {
        console.log("")
        }
    })
</script>

app.items0 = "Xmurman"
how is it responsive, solve?

Mar.11,2022

app.items0 = 'XMurman'
this kind of value belongs to the modified array object, and its essence is no different from let a = {id:1}, a.id = 2;


app.items [0] ['name'] =' Xmurman' you are modifying the properties of an object. People are talking about array items.

it's best to figure out the principle so that you won't get confused.

Menu