feat: add lifecycle hook in editor provider

This commit is contained in:
QiShaoXuan
2022-12-14 16:47:33 +08:00
parent 7734fe8928
commit 9253e9af0b
13 changed files with 155 additions and 61 deletions
@@ -16,7 +16,9 @@ export const DateCell = ({
// dayjs().format('L LT');
return (
<TableCell ellipsis={true}>
{dayjs(pageMeta[dateKey] as string).format('YYYY-MM-DD HH:MM')}
{pageMeta[dateKey] === undefined
? '--'
: dayjs(pageMeta[dateKey] as string).format('YYYY-MM-DD HH:MM')}
</TableCell>
);
};
@@ -74,7 +74,7 @@ export const PageList = ({
<DateCell pageMeta={pageMeta} dateKey="createDate" />
<DateCell
pageMeta={pageMeta}
dateKey={isTrash ? 'trashDate' : 'createDate'}
dateKey={isTrash ? 'trashDate' : 'updatedDate'}
/>
<TableCell style={{ padding: 0 }}>
{isTrash ? (