logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

vue中使用new Date()封装方法获取需要的某些时间格式xxxx-xx-xx

vue中,我们通过Vue.prototype封装方法供项目随时使用,具体见代码如下:传入时间转换为 xxxx-xx-xx 的时间格式Vue.prototype.getCurrentDataStr = dateStr => {let date = new Date(dateStr);let y = date.getFullYear();let m = date.getMonth() + 1;m

#javascript
到底了