vuepress-----6、时间更新

# 6、时间更新

  • 基于Git提交时间
  • 修改文字
  • 时间格式 moment

vuepress-----6、时间更新_第1张图片

# 最后更新时间

vuepress-----6、时间更新_第2张图片

# 时间格式修改

下载库文件
yarn add moment

const moment = require('moment');
moment.locale('zh-cn')

module.exports = {
    themeConfig: {
        lastUpdated: '更新时间',
    },
    plugins: [
        [
            '@vuepress/last-updated',
            {
                transformer: (timestamp, lang) => {
                    //return moment(timestamp).fromNow()
                    return moment(timestamp).format("LLLL")
                }
            }
        ]
    ],
}

moment官网 (opens new window)

moment中文网 (opens new window)

vuepress-----6、时间更新_第3张图片

你可能感兴趣的:(vuepress,vue)