Introduced moment.js
npm install moment --save
或
yarn add moment
Incorporated directly in the component in the required
<script> let moment = require("moment"); moment.locale('zh-cn')//汉化 export default { data(){ return{ } } </script>
Official website link http://momentjs.cn/docs/
Transfer from https://blog.csdn.net/hailangtuteng/article/details/80309950