vue中使用split()报错this.cardinfos.createtime.split is not function

首先打印一下console.log(String.prototype.split);看是不是一个函数 再者 split()是针对字符串的一种方法,首先要确保你要切割的是字符串,如果不是就要转换成字符串   一开始用 let c = this.cardInfos.created.toString().splice("."),然后继续报错 报错如下:   这样就下定义一个变量来装一下this.card
相关文章
相关标签/搜索