plugin-last-updated插件

  • VuePress 文档 @vuepress/plugin-last-updated 插件介绍

  • 具体用法:

    1. yarn add moment
    2. docs/.vuepress/config.js 中
    module.exports = {
      plugins: [
        // 最后更新时间
        [
          "@vuepress/last-updated",
          {
            transformer: (timestamp, lang) => {
              // 不要忘了安装 moment
              const moment = require("moment");
              moment.locale(lang);
              return moment(timestamp).format("YYYY-MM-DD HH:mm"); 
              // moment用法 具体 google / baidu
            }
          }
        ]
      ],
      themeConfig: {
        // 自定义
        lastUpdated: "上次更新"
      }
    };
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21

    未完待续...

上次更新: 2019-10-25 16:39