美文网首页
vue deep watch array element cha

vue deep watch array element cha

作者: ccphantom | 来源:发表于2017-11-30 01:48 被阅读0次

    if you want to push to watching array for instance, you can copy this array, then push to this copy, and then assign this copy to your watching array back. this is very simple.

    // copy array which you want to watch
    let copiedArray = this.originArray.slice(0)
    
    // push to this copy
    copiedArray.push("new value");
    
    // assign this copy to your watching array
    this.originArray = copiedArray;
    

    相关文章

      网友评论

          本文标题:vue deep watch array element cha

          本文链接:https://www.haomeiwen.com/subject/pbymbxtx.html