vue3 一些可能以后要用到的代码留存-如何获取当前年月

//用来获取当前年月
const handleTimeOld = () => {  
    let date = new Date()
    let year = date.getFullYear()
    let month = date.getMonth() + 1
    // split = '-'
    return [year, month].join('-')
}
posted @ 2024-05-15 14:29  ayubene  阅读(174)  评论(0)    收藏  举报