【开发心得】js时间加法
使用moment.js
yarn add moment
定义一个function
handleRegStartChange: function () {
var level = this.form.level;
if (level != null && level != undefined) {
var s1 = this.form.regStart.getTime() + 3600 * 1000 * 24 * (level+1); // 默认多加一天
let targetDate = moment(s1).format('YYYY-MM-DD HH:mm:ss')
this.form.regEnd = targetDate;
}
}