vue项目如何定义时间,下面web建站小编给大家介绍一下实现代码!
获取时间代码如下:
timeFormate(v) { let year = new Date(v).getFullYear(); let month =new Date(v).getMonth() + 1 < 10? "0" + (new Date(v).getMonth() + 1): new Date(v).getMonth() + 1; let date =new Date(v).getDate() < 10? "0" + new Date(v).getDate(): new Date(v).getDate(); let hh =new Date(v).getHours() < 10? "0" + new Date(v).getHours(): new Date(v).getHours(); let mm =new Date(v).getMinutes() < 10? "0" + new Date(v).getMinutes(): new Date(v).getMinutes(); let ss =new Date(v).getSeconds() < 10? "0" + new Date(v).getSeconds(): new Date(v).getSeconds(); this.nowTime = year + "年" + month + "月" + date +"日"+" "+hh+":"+mm+':'+ss ; }, nowTimes(){ this.timeFormate(new Date()); setInterval(this.nowTimes,1000); this.clear() }, clear(){ clearInterval(this.nowTimes) this.nowTimes = null; }
上面是“vue项目如何定义时间(代码介绍)”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_2912.html
workflows工作流
森林里一只空灵的犀鸟ComfyUI工作流
一只躲在一堆秋叶里的小刺猬
羚羊安上小白兔的门牙ComfyUI工作流
一只迷人的黑豹ComfyUI工作流
令人着迷的一只老虎ComfyUI工作流
一颗柔和的水晶金字塔ComfyUI工作流
一只透明老虎骨骼标本ComfyUI工作流
一个十几岁的美国女孩穿着黄色连帽衫在黑暗和空虚的背景下闲逛
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!