工作324:uni-时间过滤器封装
生活随笔
收集整理的這篇文章主要介紹了
工作324:uni-时间过滤器封装
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
filters: {toChangeDate(e) {console.log(new Date(e).getFullYear())console.log(new Date(e).getMonth())console.log(new Date(e).getDay())let dateYear = new Date(e).getFullYear(); //獲取年 let dateMonth = new Date(e).getMonth()+1<10? '0' + new Date(e).getMonth() : new Date(e).getMonth(); //獲取月 let dateDate = new Date(e).getDate()<10?'0' + new Date(e).getDate() : new Date(e).getDate(); //獲取當(dāng)日return dateYear + '-' + dateMonth + '-' +dateDate}},
總結(jié)
以上是生活随笔為你收集整理的工作324:uni-时间过滤器封装的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle 高级dba,DAVE老师O
- 下一篇: wap2010计算机考点,2010年全国