logo
  • 教程列表
  • SO官方文档
  • 阵列变化检测警告
    • 对于嵌套数组
    • 包含数组的对象数组
    • 使用 Vue.set
    • 使用 Array.prototype.splice
  1. StackOverflow 文档
  2. Vue.js 教程
  3. 阵列变化检测警告
  4. 对于嵌套数组

对于嵌套数组

Created: November-22, 2018

如果 yoi 有嵌套数组,可以完成以下操作

new Vue({
    el: '#app',
    data:{
        myArr : [
            ['apple', 'banana'],
            ['grapes', 'orange']
        ]
    },
    methods:{
        changeArrayItem: function(){
            this.$set(this.myArr[1], 1, 'strawberry');
        }
    }
})

这是 jsfiddle 的链接

  • 包含数组的对象数组
  • 阵列变化检测警告

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明