数组
错误的写法:let  listData= state.playList; // 数组深拷贝,VUEX就报错
正确的写法:let listDate= state.playList.slice(); /*不能直接操作state里面的属性,但是可以创建一个副本*/

对象
错误的写法:let  listData= state.playList; // 对象深拷贝,VUEX就报错
正确的写法:let listDate= Object.assign({}, state.playList); /*不能直接操作state里面的属性,但是可以创建一个副本*/

相关文章:

  • 2022-12-23
  • 2021-06-14
  • 2021-05-19
  • 2022-12-23
  • 2021-05-15
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2021-09-09
  • 2021-06-07
相关资源
相似解决方案