• Welcome to Journal web site.

我是 PHP 程序员

- 开发无止境 -

Next
Prev

VuePress 插件

Data: 2017-06-27 22:35:06Form: JournalClick: 11

# 插件


# 一、插件使用说明

  • 引用插件
// config.js 文件
module.exports = {
    plugins: [ 'vuepress-plugin-xxx' ]
}
  • 插件名以 vuepress-plugin- 开头,可以省略
// config.js 文件
module.exports = {
    plugins: [ 'xxx' ]
}
  • 参数
// config.js 文件
module.exports = {
    plugins: [
        ['xxx',{

        }]
    ]
}
  • 禁用插件
// config.js 文件
module.exports = {
    plugins: [
        ['xxx',false]
    ]
}
  • 备:以 @vuepress/plugin- 开头的插件是官方维护的插件。
  • 备:并非所有官方插件都会随着 VuePress 一同安装

# 二、官方插件

  • 安装
yarn add -D @vuepress/plugin-active-header-links
# OR npm install -D @vuepress/plugin-active-header-links
  • 使用
// config.js 文件
module.exports = {
    plugins: [
        // 默认是开启的
        ["@vuepress/active-header-links",false]
    ]
}
``

# 2、回到顶部:@vuepress/plugin-back-to-topopen in new window

  • 安装
yarn add -D @vuepress/plugin-back-to-top
# OR npm install -D @vuepress/plugin-back-to-top
  • 使用
// config.js 文件
module.exports = {
    plugins: [
        ["@vuepress/back-to-top"]
    ]
}

# 三、社区插件

# 1、网站变灰的插件:vuepress-plugin-graysiteopen in new window

  • 安装
yarn add -D vuepress-plugin-graysite
#或 npm install -D vuepress-plugin-graysite
  • 使用
module.exports = {
    plugins: [
        ['graysite',{
            startDate: '2021-06-30 00:00:00',
            endDate: '2021-06-30 23:59:59'
        }]
    ]
}

# 2、更多插件

  • github:Awesome VuePressopen in new window

插件插件

Name:
<提交>