工作324:uni-时间过滤器封装
生活随笔
收集整理的這篇文章主要介紹了
工作324:uni-时间过滤器封装
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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(); //獲取當日return dateYear + '-' + dateMonth + '-' +dateDate}},
總結
以上是生活随笔為你收集整理的工作324:uni-时间过滤器封装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle 高级dba,DAVE老师O
- 下一篇: wap2010计算机考点,2010年全国