eladmin-web-master/src/components/Crud/crud.js
@@ -531,6 +531,20 @@ }) }, /** * 年月格式化 * @param {Object} timestamp 时间戳 */ toMonth(timestamp) { if (timestamp == null) { return } else { const system = new Date(timestamp) const year = system.getFullYear() const month = system.getMonth() + 1 < 10 ? '0' + (system.getMonth() + 1) : system.getMonth() + 1 return year + '-' + month } }, /** * 日期格式化 * @param {Object} timestamp 时间戳 */