data: () => ({ msg: "Welcome to Your Vue.js App", week: [] }), created() { let data = []; for (let i = 6; i >= 0; i--) { data.push(this.getWeek(-i)); } this.week = data; console.log(this.week); }, methods: { getWeek(day) { var today = new Date(); var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day; today.setTime(targetday_milliseconds); var tYear = today.getFullYear(); var tMonth = today.getMonth(); var tDate = today.getDate(); tMonth = this.doHandleMonth(tMonth + 1); tDate = this.doHandleMonth(tDate); return tYear + "-" + tMonth + "-" + tDate; }, doHandleMonth(month) { var m = month; if (month.toString().length == 1) { m = "0" + month; } return m; } }
el-table利用:row-style="rowClass"设置指定行变色
一款免费开源效果酷炫的 Vue / React 大屏数据展示组件库——DataV
vue项目动态设置background背景色,解决颜色被替换问题
上面是“vuejs获取一周的时间(就是前七天)”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_102.html
workflows工作流
一个漂亮的混血女孩ComfyUI工作流
一位漂亮的女人坐在樱花树旁
一只巨大的古代乌龟后面建有一座城市的超现实场景
星空星域星球comfyui工作流
在月球上穿着太空服的宇航员
强大的长袍法师ComfyUI工作流
一个美丽的女孩穿着花瓣做的衣服
一个浑身皮毛看起来像丘巴卡的3d动漫人物
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!