Date
T-腾腾
这个作者很懒,什么都没留下…
展开
-
Uniapp中引入Ucharts统计表的使用
效果: 实现步骤: 1.在插件市场下载插件,使用hbuilderx导入即可。https://ext.dcloud.net.cn/plugin?id=271 2.新建vue文件,无需引入。 源码: <template> <view class="box"> <view class="title"> 饼图 </view> <view clas...原创 2022-04-22 23:07:10 · 1238 阅读 · 2 评论 -
Uniapp中根据生日计算年龄
getage() { var birthdays = new Date(this.birthday.replace(/-/g, "/")); var d = new Date(); var age = d.getFullYear() - birthdays.getFullYear() - (d.getMonth() < birthdays.getMonth() || (d.getMonth() =...原创 2022-04-22 22:56:30 · 379 阅读 · 0 评论 -
Vue中导入DayJs(时间戳转时间格式)
1.Npm安装Dayjs npm install dayjs --save 2.Dayjs写入到Vue原型中 import dayjs from 'dayjs'; Vue.prototype.$dayjs = dayjs; 3.在页面中调用$dayjs,进行时间戳格式化(this.$dayjs()中不传入时间戳就是获取当前时间,format()中可以按照自己需求去传入时间格式) let time = Date.now(); console.log(this.$dayjs(time).form原创 2022-03-09 11:44:36 · 5296 阅读 · 0 评论 -
Js计算账号创建天数
1.首先在methods写入一个计算天数的方法 SkyNumber(time) { let now = Date.parse(new Date(time)) / 1000; let limit = Date.parse(new Date()) / 1000 - now; let createTime = Math.floor(limit / 86400) + 1; return createTime; } 2.在行内调用SkyNumber方法,把账号创建时间的天数传进方法中 ...原创 2022-02-14 11:18:23 · 306 阅读 · 0 评论