由于要给elementui 赋值date类型
百度了好几个答案都是错误
就在官网找了下直接toDate()就可以了
时间类型 2021-08-01 14:06:26
let sja = moment(row.stime).toDate()
博客内容讲述了在处理时间类型时遇到的问题,如何正确地将2021-08-01 14:06:26这样的时间字符串转换为JavaScript的Date类型。作者在百度搜索无果后,直接在elementui的官网找到了解决方案,使用moment.js的toDate()方法可以轻松实现这一转换。
由于要给elementui 赋值date类型
百度了好几个答案都是错误
就在官网找了下直接toDate()就可以了
时间类型 2021-08-01 14:06:26
let sja = moment(row.stime).toDate()