Element-Plus DatePicker获取时间戳


0、先上答案

 <!-- 秒 -->
 <el-date-picker
   v-model="timeStamp"
   type="datetime"
   value-format="X"
 />
 
 <!-- 毫秒 -->
 <el-date-picker
  v-model="timeStamp"
  type="datetime"
  value-format="x"
/>

1、渔?

1-1 Element-Plus 官网

https://element-plus.gitee.io/zh-CN/component/date-picker.html#日期格式

没有说支持的格式,但是给了 Day.js 的入口

1-2 溯源 Day.js

Day.js 文档
https://day.js.org/docs/en/display/format#list-of-all-available-formats


在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_45020818/article/details/132129960