当前位置:网站首页>dayjs-----时间格式化
dayjs-----时间格式化
2022-08-10 08:22:00 【cc&】
1.安装
npm install dayjs --save
2.封装处理方法
methods: {
// str='默认值' str如果不传 读取默认值'YYYY-MM-DD'
formatDate(value, str = 'YYYY-MM-DD') {
return dayjs(value).format(str)
}
}
3.模板使用方法
<el-table-column label="入职时间">
<template #default="{ row }">
{
{ formatDate(row.timeOfEntry)}}
</template>
</el-table-column>
边栏推荐
- [Learn Rust together | Advanced articles | RMQTT library] RMQTT message server - installation and cluster configuration
- 二叉树 --- 堆
- 【FAQ】【Push Kit】推送服务,回执配置一直报错、回执过期修改、怎么删除配置的回执
- Rust learning: 6.5_Array of composite types
- nrm 使用详解
- 基于sklearn的决策树应用实战
- Introduction to the C language to realize bubble sort
- Using the color picker
- 人工神经网络工作原理,神经网络的工作原理
- The implementation of the seemingly useless component (text gradient) in NaiveUI is so simple
猜你喜欢
随机推荐
不同的命令行风格
时序动作定位 | ASM-Loc:弱监督时序动作定位的动作感知片段建模(CVPR 2022)
VS2013-调试汇编代码-生成asm文件-结构体内存布局-函数参数压栈-调用约定
Johnson全源最短路
winget包管理器
自动化测试框架Pytest(二)——前后置处理
【一起学Rust | 进阶篇 | RMQTT库】RMQTT消息服务器——安装与集群配置
Unity—UGUI控件
StringUtils的具体操作
Rust learning: 6.3_ Tuples of composite types
阿里云数据库 RDS SQL Server 版的服务器绑定域名www.cxsdkt.cn.的呢?
Summary of ctfshow SSTI knowledge points
初使jest 单元测试
debezium-connector-mysql拉起docker报错:debezium启动docke
UGUI - Events, iTween Plugin
Rust学习:6.1_复合类型之切片
[机缘参悟-65]:《兵者,诡道也》-7-三十六计解读-败战计
上课笔记(7)(1)——#647. 找树根和孩子(root)
CV+Deep Learning——网络架构Pytorch复现系列——classification(三:MobileNet,ShuffleNet)
Go-Excelize API源码阅读(十一)—— GetActiveSheetIndex()