SOURCE

console 命令行工具 X clear

                    
>
console
new Vue({
  el: "#app",
  data: {
    list: [1, 2, 3, 4, 5, 6, 7, 8, 9]
  },
  methods: {
    del: function() {
      this.list.splice(0, 1)
    },
    plus: function() {
      this.list.push(5)
    },
    edit: function() {
      this.list.splice(5,1,33)
    }
  }
})
<div id="app">
  <p v-for="n in list" :key="n">
    {{n}}
  </p>
  <button v-on:click="del">
    删除
  </button>
  <button v-on:click="plus">
    添加
  </button>
   <button v-on:click="edit">
    修改
  </button>
</div>