Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vanessa219/vcomment
💬 B3log 分布式社区的评论组件,欢迎加入下一代社区网络。
https://github.com/vanessa219/vcomment
b3log comment solo
Last synced: 12 days ago
JSON representation
💬 B3log 分布式社区的评论组件,欢迎加入下一代社区网络。
- Host: GitHub
- URL: https://github.com/vanessa219/vcomment
- Owner: Vanessa219
- Created: 2020-01-11T10:13:04.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-28T13:44:35.000Z (8 months ago)
- Last Synced: 2024-10-14T07:36:51.043Z (26 days ago)
- Topics: b3log, comment, solo
- Language: TypeScript
- Homepage:
- Size: 1.09 MB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 💡 简介
[vcomment](https://github.com/Vanessa219/vcomment) 🧵 B3log 分布式社区的评论组件,欢迎加入下一代社区网络。
## 🛠️ 使用文档
### CommonJS
* 安装依赖
```shell
npm install vcmt --save
```* 在代码中引入并初始化对象,可参考 [index.js](https://github.com/Vanessa219/vcomment/blob/master/demo/index.js)
```ts
import Vcomment from '../src/index'const vcomment = new Vcomment({
id: 'comments',
postId: '1353745196751',
userName: 'vanessa',
url: 'http://localhost:8080',
currentPage: 3,
vditor: {
hljsEnable: false,
hljsStyle: "github"
}
})vcomment.render()
```### HTML script
* 在 HTML 中插入 js,可参考 [index-static.html](https://github.com/Vanessa219/vcomment/blob/master/demo/index-static.html)
```html
```
### 示例代码
* [CommonJS](https://github.com/Vanessa219/vcomment/blob/master/demo/index.js)
* [HTML script](https://github.com/Vanessa219/vcomment/blob/master/demo/index-static.html)### API
#### options
| |说明| 默认值|
|---|---|---|
| id| 渲染元素的 id |-|
| postId| 文章 id |-|
| userName| 用户名 |-|
| url| 评论 API 地址 |"https://ld246.com"|
| currentPage| 评论页码|1|
| error| 获取列表错误回调|-|
|vditor|编辑器参数|-|
|vditor.hljsEnable|是否启用高亮|true|
|vditor.hljsStyle|高亮样式|"github"|
|vditor.emoji|自定义表情 { [key: string]: string }|{}|
|vditor.lang|语言|'zh_CN'|#### methods
| |说明|
|---|---|
|render|渲染评论|
|parseMarkdown(vditorOptions: IOptionsVditor)|Markdown 渲染|
|lazyLoadImage|图片延迟加载|## 欢迎关注 B3log 开源社区微信公众号 `B3log开源`
![image-d3c00d78](https://user-images.githubusercontent.com/873584/71566370-0d312c00-2af2-11ea-8ea1-0d45d6f0db20.png)