点击进入 Valine官网 ,需要先注册才能食用
安装 Valine
# Install leancloud's js-sdk npm install leancloud-storage --save # Install valine npm install valine --save
注册 vuepress 全局组件
创建 .vuepress/components/Valine.vue
<template> <div id="vcomments"></div> </template> <script> export default { name: 'Valine', mounted: function(){ // require window const Valine = require('valine'); if (typeof window !== 'undefined') { this.window = window window.AV = require('leancloud-storage') } new Valine({ el: '#vcomments' , appId: '',// your appId appKey: '', // your appKey notify:false, verify:false, avatar:'mm', placeholder: 'just go go' }); }, } </script>
使用 Valine
只需要在 markdown 中调用即可
<Valine></Valine>