wineList-MiniApp/miniprogram/pages/logs/logs.ts

20 lines
362 B
TypeScript
Raw Normal View History

2023-04-28 18:04:49 +08:00
// logs.ts
// const util = require('../../utils/util.js')
import { formatTime } from '../../utils/util'
Page({
data: {
logs: [],
},
onLoad() {
this.setData({
logs: (wx.getStorageSync('logs') || []).map((log: string) => {
return {
date: formatTime(new Date(log)),
timeStamp: log
}
}),
})
},
})