改用原生Valine

This commit is contained in:
tlyong1992
2022-05-25 11:06:59 +08:00
parent 8c19d88630
commit 250e9e03f9
4 changed files with 39 additions and 23 deletions

View File

@@ -0,0 +1,26 @@
import BLOG from '@/blog.config'
import React from 'react'
import Valine from 'valine'
const ValineComponent = (props) => {
const { path } = props
React.useEffect(() => {
const valine = Valine({
el: '#vcomments',
appId: BLOG.COMMENT_VALINE_APP_ID,
appKey: BLOG.COMMENT_VALINE_APP_KEY,
avatar: '',
path: path,
recordIP: false,
placeholder: BLOG.COMMENT_VALINE_PLACEHOLDER,
serverURLs: BLOG.COMMENT_VALINE_SERVER_URLS,
visitor: true
})
if (!valine) {
console.error('valine插件加载失败')
}
})
return <div id='vcomments'></div>
}
export default ValineComponent