好的,在 Vue 中转换日期格式为 yyyy-mm-dd 不使用 toISOString() 的方法是:
constdate = new Date('Mon Jan 02 2023 00:00:00 GMT 0800 (中国标准时间)');
const year = date.getFullYear();
const month = ('0' + (date.getMonth() + 1)).slice(-2);
const day = ('0' + date.getDate()).slice(-2);
const yyyyMmDd = `${year}-${month}-${day}`;