vue中使用Moment.js

1.安裝模塊 npm install moment --save 2.在main.js中引入 import moment from 'moment'; //導入模塊 moment.locale('zh-cn'); //設置語言 或 moment.lang('zh-cn'); Vue.prototype.$moment = moment;//賦值使用 3.使用 this.$moment('2019
相關文章
相關標籤/搜索