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

问题:[Vue warn]: Error in render:

错误代码:

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(',');
参考文章: 点击打开链接

你可能感兴趣的:(vue全家桶)