博客vuepress添加评论功能

博客vuepress添加评论功能

目前,vuepress-plugin-comment 支持在 Vuepress 中使用 Valine,自动管理 SPA路由 相关的工作。
记得安装插件valine,不然评论一直出不来,我前面是没按一直出不来。

安装插件

如果使用 npm:

npm install --save vuepress-plugin-comment
npm install --save valine

如果使用 yarn:

yarn add vuepress-plugin-comment -D
yarn add valine -D

注册leancloud

leancloudhttps://leancloud.cn/

创建应用

在这里插入图片描述

获取appId和appKey

在这里插入图片描述

快速使用

将 vuepress-plugin-comment 添加到vuepress项目的插件配置中:

module.exports = {
    
    
  plugins: [
    [
      'vuepress-plugin-comment',
      {
    
    
        choosen: 'valine', 
        // options选项中的所有参数,会传给Valine的配置
        options: {
    
    
          el: '#valine-vuepress-comment',
          appId: 'Your own appId',
          appKey: 'Your own appKey'
        }
      }
    ]
  ]
}

猜你喜欢

转载自blog.csdn.net/qq_39367226/article/details/107449901