安装moment npm i moment --save 单文件使用 import moment from 'moment' this.form.month = moment(需要转换的时间 this.form.month ).format('YYYY-MM') 全局使用 import mom