开箱即用的函数
cycleDate() {
// time为时间戳
let times = new Date('2022-02-11').getTime();
let delta = (new Date().getTime() - times) / 1000;
// return `${Number(delta / (60 * 60 * 24 * 365))}年前`;
// return `${Number(delta / (60 * 60 * 24 * 30))}个月前`;
// return `${Number(delta / (60 * 60 * 24 * 7))}个星期前`;
// return `${Number(delta / (60 * 60 * 24))}天前`;
// return `${Number(delta / (60 * 60))}个小时前`;
return `${Number(delta / 60)}分钟前`;
}