npm.io
1.1.22 • Published 7 years ago

coral-comment

Licence
MIT
Version
1.1.22
Deps
3
Size
152 kB
Vulns
0
Weekly
0

安装

tnpm install --save @tencent/coral-comment

使用

方法一: 直接引用
import {CircleComment} from '@tencent/coral-comment';
import '@tencent/coral-comment/css/index.css';
方法二: 按需加载(推荐)
  • 安装babel-plugin-import

      npm i --save-dev babel-plugin-import
    
  • 在.babelrc中配置

      ['import', {libraryName: '@tencent/coral-comment', "libraryDirectory": "lib", "style": true}]

    参数说明:

    • "style": true //引入less文件

    • "style": "css" //引入css文件

    使用less文件时可以自定义主题, 具体可以参考ant design的主题设置

组件

CircleComment
CoralComment
HeadComponent: 头像组件
UserinfoComponent: 用户信息
ContentComponent: 评论内容信息
CommentinfoComponent: 评论信息(点赞数, 回复数等)
ReplyComponent: 回复信息
PictureComponent: 图片信息