Why has the vue data not changed?

the result of + 1 pops up after clicking the button, but why does the result show that there is no + 1 or the original value after the pop-up window disappears? Another question is that if I keep clicking this button, it should always be + 1. Why does the result of alert always be 112or 445? I didn"t understand
Test.vue

after thinking about it all day yesterday.
<template>
 <div>
    <div id="main">
      <div id="center">
        <div>
          <div class="blog" v-for="(item, index) in all" :key="index">
            <Test2 :info="item.info" :key="index" :indexs="index" v-on:increment1="incrementTotal"></Test2>
          </div>
        </div>
      </div>
    </div>
 </div>
</template>

<script>
import Test2 from "@/components/Test2"

export default {
  name: "Blog",
  data () {
    return {
      all: [
        {content: {a: 111, b: "ccc"}, info: {num: [111]}},
        {content: {a: 222, b: "ccc"}, info: {num: [444]}}
      ]
    }
  },
  methods: {
    incrementTotal: function (num2) {
      alert(this.all[num2].info.num[0] + 1)
      this.all[num2].info.num[0] + 1
    }
  },
  components: {
    Test2
  }
}
</script>

<style scoped>
</style>

Test2.vue

<template>
 <div>
       <button @click=change(indexs)>
          {{info.num[0]}}
       </button>
  </div>
</template>

<script>
export default {
  name: "Info",
  props: ["info", "indexs"],
  methods: {
    // num2all
    change (num2) {
      this.$emit("increment1", num2)
    }
  }
}
</script>

<style scoped>
</style>
Apr.27,2021

this.all[num2].info.num[0] + 1
Change

to

this.all[num2].info.num[0] += 1

if the update cannot be triggered
ide/list.html-sharp%E6%95%B0%E7%BB%84%E6%9B%B4%E6%96%B0%E6%A3%80%E6%B5%8B" rel=" nofollow noreferrer > vue array update detection


it is recommended to make a deep copy of the original this.all into cloneAll

then change [num2] .info.num [0]

in cloneAll

then this.all=cloneAll

Deep copy can be done by Baidu. It's very simple

.
Menu