How to get the definition variable from the string passed by vue

export default {
  data() {
    return {
      addArr1: []
      addArr2: []
      addArr3: []
      addArr4: []
    };
  },
  methods: {
    addItem (name) {
      let arr = this[name]
      arr.push(PParr.length)
    }
-------------------------------------------------------------------------



May.22,2021

it can be tested

<template>
  <div class="hello">
    <input v-model="name" />
    <button @click="onClick">click</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      name:'',
      addArr1: [],
      addArr2: [],
      addArr3: [],
      addArr4: []
    };
  },
  methods: {
    addItem (name) {
      console.log(name)
      let arr = this[name]
      console.log(arr)
      arr.push(PParr.length)
    },
    onClick(){
      this.addItem(this.name)
    }
  }
}
</script>

clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb4b0a-24f7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb4b0a-24f7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?