From be7de7bdbd8435e673290fbad6e0e0b8ee2e787d Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Mon, 25 Mar 2024 14:16:18 +0800 Subject: [PATCH] docs: update themeConfig `lastUpdated` doc --- docs/notes/theme/config/主题配置.md | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/docs/notes/theme/config/主题配置.md b/docs/notes/theme/config/主题配置.md index 8e211e69..dafb6083 100644 --- a/docs/notes/theme/config/主题配置.md +++ b/docs/notes/theme/config/主题配置.md @@ -438,15 +438,29 @@ type NavItem = string | { ### lastUpdated -- 类型: `boolean` -- 默认值: `true` -- 详情: 是否显示最后更新时间 +- 类型: `false | LastUpdatedOptions` +- 默认值: `{ text: 'Last Updated', formatOptions: { dateStyle: 'short', timeStyle: 'short' } }` +- 详情: 最后更新时间 -### lastUpdatedText +```ts +interface LastUpdatedOptions { + /** + * 设置 最后更新时间 的文本 + * + * @default 'Last updated' + */ + text?: string -- 类型: `string` -- 默认值: `'Last Updated'` -- 详情: 最后更新时间的文字 + /** + * 设置最后更新时间格式的选项。 + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options + * + * @default + * { dateStyle: 'short', timeStyle: 'short' } + */ + formatOptions?: Intl.DateTimeFormatOptions & { forceLocale?: boolean } +} +``` ### contributors