Vue 默认显示当天日期
2023-07-17 本文已影响0人
懵懵懂懂_YOYO
const today = new Date();
const year = today.getFullYear();
const month = (today.getMonth() + 1).toString().padStart(2, '0');
const day = today.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;