[Vue warn]: Error in render: "TypeError: this.formData.subImages.split is not a function" - Go语言中文社区

[Vue warn]: Error in render: "TypeError: this.formData.subImages.split is not a function"


问题:

错误代码:

computed:{
  //附图轮播图
  subImgList(){
    let imgArray = this.formData.subImages.split(',');
    imgArray.map(n => {
      this.subImg.push({
        name:'sub-img',
        url:n
      })
    })
    return this.subImg;
  },
},

解决办法:

let imgArray = (this.formData.subImages || "").split(',');
参考文章:点击打开链接
版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/qq_30632003/article/details/79847538
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-03-07 18:49:24
  • 阅读 ( 936 )
  • 分类:前端

0 条评论

请先 登录 后评论

官方社群

GO教程

推荐文章

猜你喜欢