import moment from "moment";
// 设置语言为中文
moment.locale("zh_cn")
//xxx年前的数据 需要传入秒 所以 *1000
this.imgDetail.cnTime = moment(this.imgDetail.atime*1000).fromNow()
console.log(moment('2021-03-29').fromNow()) // "10 分钟前"
import moment from "moment";
// 设置语言为中文
moment.locale("zh_cn")
//xxx年前的数据 需要传入秒 所以 *1000
this.imgDetail.cnTime = moment(this.imgDetail.atime*1000).fromNow()
console.log(moment('2021-03-29').fromNow()) // "10 分钟前"